{"_id": "35jENGmBWk9FnT87t", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (some t : Teacher | t->c in Teaches )\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\tall t : Teacher\n  \t\t| (some c : Class, p : Person, g : Groups\n  \t\t\t| c->p->g in Groups and t->p in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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\tall p1 : Person | (p1 in Teacher) or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher) or\n\t\t\tsome p3 : Person | (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher)\n\t\t)\n  \t\t\t\n}", "derivationOf": "2NELgLBSnKJCesnTo", "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-10-29 09:28:54"}
{"_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": "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": "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": "H3SPnAS7epxmfvkvE", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student | some g:Group,c:Class | c->s->g in Groups implies (all t:Teacher | 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": "GWxF99Yb4We8mr3CE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:28:27"}
{"_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": "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": "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": "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": "q7cCE98mTu5gxtwHD", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\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,p1:Person | p->p1 in Tutors implies p in Teachers and p1 in Students \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SwXYy3yrfvh9pxynr", "msg": "The name \"Teachers\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:57:03"}
{"_id": "KCBtzq9yDCcEh8dn4", "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  always 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 expression failed to be typechecked line 47, column 3, filename=/tmp/alloy_heredoc5148262566268884436.als", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-22 10:36:37"}
{"_id": "dQ5CXgk8FDoGaYmzm", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "7hN6Hde8uG4JR52Y8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 01:58:15"}
{"_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": "AnLjqSDQMsw8t9Sd7", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ndR6Y5Asoqmcxf9gw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:03:52"}
{"_id": "npev6MPmTQbDCgsXz", "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 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  all t: Teacher, g:Group, c:Class, s:Student | c->s->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": "PjxpjBSPZGN4RAYmd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-4 22:47:25"}
{"_id": "D4Q4BQFzB2LqARus2", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "dQ5CXgk8FDoGaYmzm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 01:58:30"}
{"_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": "8CYYrGSDdMTemReKy", "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 f : Person | f in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall f : Person | f not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall f : Person | f 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\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teaches->c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yhejxrJ6Px5RtxEoB", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class->this/Class}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:25:50"}
{"_id": "DdGB5uLxHPv3S5hBv", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s,t:Person | all c:Class | 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\t\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 11:47:58"}
{"_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": "reEGXyJ9Z2iQAeRQD", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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": "kaXoZ3ww6EHdGvKbM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:51:53"}
{"_id": "j34iPpwA5Fxw4KWsM", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Person | some c : Class, s : Person, g : Group | c->s->g in Groups and t->c in Teaches and t in Teacher and s in Student\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, g : Group | some t : Person | c->s->g in Groups and t->c in Teaches and t in Teacher and s in Student 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": "wLHxhsFNnnRygMWrz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:12:42"}
{"_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": "trERrtYpLYm5TRb45", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall f1,f2:File | f1->f2 in link implies f2 not in Trash \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p1,p2:Person | p1->p2 in Class implies p1 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": "9DqMyrbofMwcvevcQ", "msg": "The name \"File\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:31:48"}
{"_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": "GBShAFg9yz9G7Y7k8", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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/* There classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t.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": "fe9eBZiiFesNLGy9J", "msg": "The name \"class\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:12:07"}
{"_id": "H5ANQRQJtE4zwBPsL", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s,t:Person | all c:Class | 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\t\n}", "derivationOf": "9Eo77Sg25zKQjys5z", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:47:48"}
{"_id": "WbPLfXRRFauvsfQHR", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class |all s :Student |some t:Teacher |some g:Group|  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": "p6StA8Ax8CWbbRSye", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 12:40:44"}
{"_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": "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": "WRhwk3v33ccC4dtSK", "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 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  all t: Teacher, g:Group, c:Class, s:Student | t->c in Teaches  implies 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": "2vEm4FQHNpQECkJwp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-4 22:49:33"}
{"_id": "xvAWLGxRq4abiy7Ai", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\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\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vkGs5xoodaZsuAswS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:26:06"}
{"_id": "sJEaXCaXEkZqdp5Rz", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | 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": "FrgTrZezjuMQwHYcB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:17:18"}
{"_id": "iPSkRZHhmeSKsq6ve", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 | lone c : Class | t->c in Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | one t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "J7iksNr3KkcE5gCTg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-5 09:01:49"}
{"_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": "GavusxpiQzgpiKKH3", "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, 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 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\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 p1, p2 : Person, c : Class | (some g : Group | c->p1->g in Groups) implies p2->c in Teaches implies p2->p1 in Tutors\n\t\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": "x2CtD4rJLSRbMwDqd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:48:43"}
{"_id": "wybffWWynojPkyJBb", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(all c : Class | all 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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "SqotzmqWsXc6XE7dv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:17:34"}
{"_id": "Syn6cWoiLon6uo7Cn", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->g->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": "m7kaA749cJhr3P4mk", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Group->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:22:21"}
{"_id": "7RRQaeSHLTNRTfCDD", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\n  \t\t| some g : group\n  \t\t\t| c->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\n  \t\t| c->p->g in Groups implies\n  \t\t\tsome 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": "dbgmpweFDxdWBy8gH", "msg": "The name \"group\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 20:11:52"}
{"_id": "zXTyQsuYZRybRbXRN", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7FiypXn7s37Byzszk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:34:51"}
{"_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": "mmqpowxJGphbQ8LBv", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, g : Group | some c : Class, t : Teacher | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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\tall p1, p2, p3 : Person | (p1 -> p2 in Tutors and p2 -> p3 in Tutors) implies p3 in Teacher\n}", "derivationOf": "huDYb6ANtFTgJ8gyq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 00:04:44"}
{"_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": "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": "e3HpaZSLfSWqTZzJK", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Teacher | p.Tutors in Student and Groups[p]\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jM2FuQatxqXFq2Rfh", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none->none}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 15:15:19"}
{"_id": "6cHnphLn6FfuX4m6A", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  some g : Group | all c : Class, s : Student | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \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 p1, p2 : Person{\n    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": "JrY8rfzeATiAaisGb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:20:09"}
{"_id": "noTLTp2jhd9y4CBQn", "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\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) and (p in Teacher implies p not in Student) \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\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": "urbFoMpnEkRB7Yg5X", "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-10-27 19:28:35"}
{"_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": "eB7E8wAXk4SGR6rzN", "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\t(all s : Student | some g : Group | all c : Class |  (s->g)->c in Class)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "n3EKMmz8wLjtYi9NG", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group->this/Class}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 22:59:42"}
{"_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": "vLYfeHboM5DCvytop", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "e5yB7tDP2o4Xeb7wY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:17:20"}
{"_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": "J3ovEsuam2MYZBn9d", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p 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": "gGcaTjiTnCN4uP4Bd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:21:23"}
{"_id": "jL3jEB6iEzr5S8AEk", "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\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": "NWRYbNDKArCGJAiw2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:56:57"}
{"_id": "tbopxmMXFsmRB6YPN", "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 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": "WWERt9L9XA6uwx6kn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 13:20:33"}
{"_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": "wvBLwFwSMnEbvuRMf", "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\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t(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\t(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\t(all c : Class, t : Teacher | t->c in Class imples\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\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}", "derivationOf": "L3DMqYwy9ocAm6Jcz", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:20:37"}
{"_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": "NrSGMLedteQqpfaAr", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 (Person-Student-Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t:Teacher | some t.Teaches\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some( c.~Teaches & Teacher) \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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": "gae4LoiTgsyXdZw89", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 18:23:18"}
{"_id": "uPKzfGkyobEpmPFAa", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  \tall x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x 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 x : Teacher | some y : Class | x -> y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  \tall c : Class | all t, x : Teacher | t -> c in Teaches and x -> c in Teaches implies t = x\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, t : Student | some g : Group | c -> t -> 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, 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 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": "Yv3gnwY8ubsBdYwkf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:58:30"}
{"_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": "8cwhqxE3vA5SvijTR", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p : Person, t : Teacher, c : Class, g : Group\n  \t\t| (c->p->g in Groups and t->p in Teaches) implies 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\tall p1 : Person | (p1 in Teacher) or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher) or\n\t\t\tsome p3 : Person | (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher)\n\t\t)\n  \t\t\t\n}", "derivationOf": "eHdwZv3sEn82th3ML", "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-10-29 09:32:09"}
{"_id": "HPcMHx8pPYLd2wMy4", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  some t: Teacher | lone t.Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GgYYvn8qidfCYnhBE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 14:46:30"}
{"_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": "KaWsYZHnRy7nQWs6c", "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  { all x.Class | some p.Person, g.Group: x -> p -> g in Groups implies some t.Teacher: t->x in Teaches}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eqoYAbLpmvh546fL4", "msg": "There are 1 possible tokens that can appear here:\n}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:36:25"}
{"_id": "KCwvDZCdMsX8fawYH", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, g : Group, p : Person, t : Teacher | t -> c in Teaches implies c -> p -> g in Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | some c: Class, g: Group | 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": "BjpW4KnDEX9N2aJWq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:07:49"}
{"_id": "ReotEMb5vENKAJBdT", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "6cHnphLn6FfuX4m6A", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:21:40"}
{"_id": "g56oLAaxhEcEEHqWN", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n \tall s :Person, c:Class | (some g:Group | c->s->g in Groups) implies  (all t:Person| t->c in Teaches implies t->s in Tutors)\n  \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JRnXMjd66pMqJGrbA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:37:19"}
{"_id": "DH2rp4oDnhpxEjJbF", "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\tno Teacher\n    \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JMXcp4MRnPnFnMNos", "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": "2020-10-27 19:39:29"}
{"_id": "3krqvQT3SRoq26A3e", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\t\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": "xMBijG568fKdG94zJ", "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": "2020-10-29 09:54:24"}
{"_id": "dwC896nkkTfSWuDrz", "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\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\tall p : Person | no (p.Tutors + p.Teaches) and no (Student + Teacher) and no (Class)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Ey8qnNWbjgPPPEF4W", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "theme": {"currentFramePosition": {}, "currentState": 0, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/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/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": "2020-10-27 20:09:56"}
{"_id": "mRJ7Qy2CFsbHr47DM", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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  some c:Class ,g:Groups | all s :Student | g in c\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zkAsJDFrr8tRJYToT", "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": "2020-10-27 13:56:56"}
{"_id": "4DKgxfXAh37CNoXuN", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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": "4FECGM4pjKLfgbsSb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 20:59:41"}
{"_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": "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": "tthD3AWztXg9ExZLs", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | all  c: Class | some g: Group | c->t->g in Groups implies t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "y8SidGi8jCcYhiio4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:23:40"}
{"_id": "T8vRy6gHh7ybvtJY5", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some c:Class,g:Group | t->g in c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jqd5YgjPAArMgSSCc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:06:58"}
{"_id": "8PRTGX2cvwqTqzz5T", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {\n}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5tQKMbejBE33EkRRf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:16:39"}
{"_id": "LWpjRKdCEhyA8iGGF", "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}\n\n/* There are no teachers. */\npred inv2 {\n\t\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There 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\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "S43YQguysjNigrw9m", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 13:34:36"}
{"_id": "e5yB7tDP2o4Xeb7wY", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7GLQpta9QjMe7q4Hn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:16:58"}
{"_id": "4DCdKDrikNugRtPZN", "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, 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 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\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 p : Person, c : Class | (some g : Group | c->p->g in Groups) implies (all t : Person | t->c in Teaches implies 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": "vtTTHvmBtmNjRkXtm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:39:10"}
{"_id": "pNp8H5HCJaGg6AsJf", "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\t(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": "W9G4Q55XJ2ZnMPDM5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 17:08:02"}
{"_id": "5gTQXH3frxw49jgmE", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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 \tall t:Teacher | some g:Group,c:Class | 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 p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by 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}", "derivationOf": "68qLj4baHKcFWt4Gx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:49:47"}
{"_id": "qsWhWAjDNmWCHCH8L", "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\t(all s : Student | some g : Groups | 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": "yDCChW6Ek75XzXcFY", "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": "2020-10-28 22:58:51"}
{"_id": "QeHizhXtvDw75kPyr", "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 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": "ZdeXTWQDT2XczpGxC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 21:20:30"}
{"_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": "j6aWr8TXoQHoqgKf4", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, p1, p2 : Person | (p1 in Teacher and p1->c in Teaches) implies (p1->p2 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": "EWwYFcAwsM8cDbGt6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:04:40"}
{"_id": "YTHH782Wh3FBdhC9B", "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 all 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 Teacher and p not in Student)or(p not in Teacher and p in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\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-10-28 17:49:21"}
{"_id": "5bzWBkJwKFXgnFqmS", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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  some 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\tall t: Teacher | all s: Student | t->s in Tutors and (not s->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": "rCwfFtw8XnzCM5HYZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:55:20"}
{"_id": "ZmuaPfuMzSAfzrb9f", "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 = Student\n}\n\n/* 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 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\tall x : Person | x in Student or x 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": "xaMfFNaLMt8mR6np7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:07:46"}
{"_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": "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": "2ipKjuGMwqtshtQYg", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student, 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": "hdPXKneg7ycvboQ7q", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:31:13"}
{"_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": "9DqMyrbofMwcvevcQ", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (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": "5d7sm4aYCARzKyCFH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:29:39"}
{"_id": "zr8WcShmtmXq9HJeL", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig 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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GFCxoajXwAFi9ABnP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:19:24"}
{"_id": "FbNvx6N6cXuaExBHo", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 p: Teacher | some c: Class | some g: Group | c->p->g in Groups and p->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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 | some g: Group | all c: Class | 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": "pdeFzuP3mcoizneCW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:15:19"}
{"_id": "ABRfwJACu9uZf3XgJ", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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": "Qrk3bCgNfYSm8wuJZ", "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": {"Group": {"x": 805.3229166666666, "y": 199}, "Person": {"x": 402.66145833333337, "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": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "#7FDBFF", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "general"}], "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": "general"}], "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-9-30 10:04:06"}
{"_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": "Eq8z4JygGYqomJDwF", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tsome s :Student | some c:Class | some g:Group | c->s->g in Groups and (some t:Teacher| t->c in Teaches and t->s in Tutors)\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "8W6kBSFpM9mhFauuN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:07:45"}
{"_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": "kZjDo7ykezLZurRGQ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall 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 Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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\tall c : Class, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n  \t\t\tsome 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": "cGrdT7xffuqAXBxFq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 20:04:39"}
{"_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": "uyBnAR8soc8A7LpGn", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (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\tall p1,p2:Person | p1->p2 in Class implies p1 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": "trERrtYpLYm5TRb45", "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": "2020-10-29 09:31:52"}
{"_id": "uT7LSd2RSYWFa9aJa", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->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": "swRQMhrN6eW6g2Y7Z", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:16:03"}
{"_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": "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": "BySMiHedeSkte2zkZ", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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\tall p1, p2 : Person\n  \t\t| 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\tall p1,p2,p3 : Person\n  \t\t| p1 in Teacher or\n  \t\t  (p2->p1 in Tutors and p2 in Teacher) or \n  \t\t  (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher)\n}", "derivationOf": "C4EBeDjrn2y4vesQy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 22:02:41"}
{"_id": "2scmq3HTSnsTdJCh8", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tsome g: Groups | lone t: Teacher | t.Teaches.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": "uC4te8zZeJuvFALHo", "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": "2020-10-27 14:53:35"}
{"_id": "6gp6HSYW34FkTyw4H", "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\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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": "MmTzJnLaRe3QzHPXw", "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-10-29 09:50:57"}
{"_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": "Zxif7TjiW2iaT264v", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Teacher | p.Tutors in Student and p.Teaches in Class.Groups[p]\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ogiQpmqEum6qG2wFt", "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": "2020-10-27 15:17:01"}
{"_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": "JKfkDb8yLoiMxwJfj", "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\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | c->s->g in Groups and t->c in Teaches and 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": "JWKiKghT7LnNAwvam", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:33:41"}
{"_id": "TXZRzGwtfN5wvuABt", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t: Teacher| (some x:Class | t->x in Teaches) implies some g:Group | t->g in Tutors \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\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": "BNhDR63xnRphTun2e", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:28:32"}
{"_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": "QsFKehuk9F9n5aFDP", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all p1, p2 : Person | some c : Class | some g : Group | p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->c in Teaches and p2->g in c.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 p1,p2 : Person , c : Class| p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->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": "n6P2Y4LjGrgtLZXaE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:16:45"}
{"_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": "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": "Yaa5gdnooeiAKeyu3", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x 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": "WALmDdEkZ3ha7jgZe", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:55:11"}
{"_id": "dksLfjBLAYC5adz4k", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\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 | 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 | 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,t2:Teacher | all 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 | 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\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": "KLLtWceg8SCwi4Ho6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:11:37"}
{"_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": "wdhuCvzJWf4DmbLTM", "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": "2021-1-13 21:32:56"}
{"_id": "439A8z4qJmnz9gYxo", "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\t(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\t(all t : Teacher | some c : Class | t->c in Teaches and (some s:Student, g:Group | c->s->g in Groups))\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "tcx7tTQWoTiZqeAmZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:26:41"}
{"_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": "J4MtksGDmnDKSCY9c", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class | some t : Teacher, g : Group | c -> t -> g in Groups\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall 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\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = 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\tall 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": "5eX9YQEya6oSBY2DR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:44:00"}
{"_id": "ju7AYgLcpciw526Nj", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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": "LvJbXxHP5mBfgA6Wo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 21:48:12"}
{"_id": "uGkkAi436bL2Yu5Xe", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\n  \t\t| some g : Group\n  \t\t\t| c->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\n  \t\t| c->p->g in Groups implies\n  \t\t\tsome t : Teacher | t->c 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\tall p1, p2 : Person\n  \t\t| 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": "3utQzMDQPmtTJjKJw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 20:44:40"}
{"_id": "XfZCn5PZjHspEftdB", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  \tall s :Student| some g:Group | 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": "2tA5tFPxr93GcvRDp", "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": "2020-10-27 12:21:11"}
{"_id": "gHNS7ZAJCBt6S9Sn8", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, p1, p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student and p1->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": "24ccfudCWacPrfGZr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:05:57"}
{"_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": "wqBRYAbeovfvNQcav", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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  some c:Class ,g:Groups ,t:Teacher| all s :Student | (c->(s->g) in Groups  and t->c in Teaches) \n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "57gRRqb25JF2mvMsn", "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-10-27 14:00:06"}
{"_id": "tc7bR92d4mHRpvoxB", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 :\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zD6ZPD5oQSWF2CxnN", "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": "2020-10-28 15:33:32"}
{"_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": "YceETJNNAGxijeWPP", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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 | some g: Group | some c: Class | 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": "KHNxQ6HvCAiXYTcBL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:06:49"}
{"_id": "fQnnBwe2iNcoabKpr", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 (Person-Student-Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t:Teacher | some t.Teaches\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher 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": "RDTFA3AhEQwJEeAKu", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2021-1-13 17:47:02"}
{"_id": "o53fnFfezWnnhvgCF", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\tall c : Class, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n  \t\t\tsome t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c : Class, g : Group\n  \t\t| (some t : Teacher | t in Teacher)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hcNCWEWA5j69BEkEG", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 20:07:28"}
{"_id": "dtYJcrrPXuaBX6Xi6", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\t\n  \t\n  \t\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n  \tall p1 : Teacher , p2 : Student | 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  \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": "EPEzyTedWsQdphhE5", "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-10-28 03:45:55"}
{"_id": "tNKPme63gogbbCNpf", "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\t(all 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\t(some 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\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": "TwArtEn8dgceoxugL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:41:45"}
{"_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": "aq2NQWoNABvAbCQgH", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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": "s82RMCGjzErL43GKi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-12 00:54:20"}
{"_id": "iTCbimHjfj3mD4HYZ", "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 f : Person | f in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall f : Person | f not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall f : Person | f 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\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { \n\tall c : Class | #(Teacher->c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EAjAm7YADqMqFRY2H", "msg": "& 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": "2020-10-29 10:26:28"}
{"_id": "wc89vYLgkRD2CLBfu", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t(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\t(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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\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}", "derivationOf": "iDaQ3F4Zcxk3Eefaa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:16:17"}
{"_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": "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": "erNMKGtZngmqpZDsp", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher | all c : Class | all d : Class | x->c in Teaches and c!=d implies x->d not in Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t : Teacher, y : Teacher | all c : Class | t->c in Teaches and y->c in Teaches t==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": "xyEMEPeChSLrFPj5M", "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": "2020-10-29 10:31:51"}
{"_id": "JRhJqeQe8ZniHRHrt", "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\t(some t : Teacher, s : Student | t->s in Tutors implies 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": "Tw2MgjtGQnSHJAaH6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:33:05"}
{"_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": "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": "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": "dbGcfT33N2DLAqAuP", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, g: Group, p: Person, 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\tall t: Teacher | some c: Class, g: Group, 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\tall p,pp: Person | p->pp in Tutors implies p in Teacher and pp in 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": "CZDsrmE7EqonhxiX3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:12:20"}
{"_id": "s9RhrizFbTxuAmcZ7", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group, p : Person | 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LDtwHTEQQRr7C6TzJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:15:39"}
{"_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": "bxPio7AYhchP438kd", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => c->Person->Group not in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "shpzAsTbXhqyc789A", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-31 12:53:36"}
{"_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": "Yv3gnwY8ubsBdYwkf", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  \tall x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x 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 x : Teacher | some y : Class | x -> y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  \tall c : Class | all t, x : Teacher | t -> c in Teaches and x -> c in Teaches implies t = x\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, t : Student | some g : Group | c -> t -> 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 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 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": "N64hLYYqCLCH4FDwy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09: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": "XFSw7d9mGzi6yL2Hz", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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  some c:Class |some g:Groups |some t:Teacher| all s :Student | 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\n}", "derivationOf": "ABgEEGZnmKwzp5vnL", "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-10-27 14:13:08"}
{"_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": "HCn2HA4smKgHDXFmr", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> 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/* 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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t: Teacher| some x:Class | t->x in Teaches implies some g:Group | x->g in Groups \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\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": "Qvicto6HiouR7v82T", "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": 290.8333435058594, "y": 199}, "Class1": {"x": 581.6666870117188, "y": 199}, "Class2": {"x": 872.5000305175781, "y": 199}, "Group0": {"x": 290.8333435058594, "y": 298.5}, "Group1": {"x": 581.6666870117188, "y": 298.5}, "Group2": {"x": 872.5000305175781, "y": 298.5}, "Person": {"x": 581.6666870117188, "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": "2020-10-29 11:47:17"}
{"_id": "JKx9YywGMi3dh4eQ3", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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 p1 : Person, p2 : Person, p3 : Person\n  \t\t| p1 in Teacher or\n  \t\t( p2 in Teacher and p2->p1 in Tutors) or\n  \t\t( p3 in Teacher and p3->p2 in Tutors and p2->p1 in Tutors)\n}", "derivationOf": "5jtdkLmcagasv97Gd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:38:33"}
{"_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": "gZ5kiR8hf6eBjKKpj", "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 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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x not in Teacher\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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class | some t1, t2 in Teacher | t1->c in 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": "P9jBQHH54LRXS57An", "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-10-29 10:00:50"}
{"_id": "JSTG5cJSGifMd3em9", "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 | 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 | 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,t2:Teacher | all 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  \t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n  \tall t:Teacher | some c:Class,g:Group, s:Student |  c->s->g in Groups implies t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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,g:Group | some t:Teacher | (t->s in Tutors) implies ( (t->c in Teaches) 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": "3YMAcosfNATkJK62X", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-4 22:45:26"}
{"_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": "Zf9Dj8z837ZxsmGRk", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group, p : Person | 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  all p : Person | some c : Class, g : Group | c->p->g in Groups and p in Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "d3Yx6JyqsYaRBXayy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:18:06"}
{"_id": "MHpWvHuHPLNRwr4mL", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some t : Teacher | some g : Group | c->t->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\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* 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\n}", "derivationOf": "NHycNPmG9pP7va4rw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:08:11"}
{"_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": "esjrFsdEGbTfS4ydG", "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\t(some 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": "QBgKNHgoRrSKXGJ8d", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:34:41"}
{"_id": "T9KusJjkc2d9Gee2q", "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\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t(all p : Person | p in Student implies p not in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t(all p : Person | p in Student or p in Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t(some t : Teacher | some c : Class | t->c in Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t(all t : Teacher | some c : Class | 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": "z9Ec4jNiS5cwnQEdQ", "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-10-28 22:46:48"}
{"_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": "7fWZMaw8vHSDHx3xx", "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\t\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": "TGHsgjuJ9g59eJRE5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:03:42"}
{"_id": "zm9pRdeTShQL9kakQ", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some c.Groups) implies (some (Teacher & c.~Teaches))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some (t.Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n  all p : Person {\n  \t(some (p.(~Tutors) & Teacher)) or\n  \t(some (p.(~Tutors).(~Tutors) & Teacher)) or\n\t(some (p.(~Tutors).(~Tutors).(~Tutors) & Teacher))\n  }\n}", "derivationOf": "WNa9W24avPQhrnfQL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:11:18"}
{"_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": "8PiYPFvtxX5niCnK6", "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\tStudent disj 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": "DtDHrTbjfm8qHHKcG", "msg": "There are 1 possible tokens that can appear here:\n[", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 19:19:08"}
{"_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": "qtimdwyWDv2kydLXq", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\tsome c : Class, t : Teacher | t -> c in Teaches implies all g : Group | c -> p -> g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "QqQMud2FgMXHccWQk", "msg": "The name \"p\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 02:33:25"}
{"_id": "54sDQrqaMhjtarzuw", "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\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\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 \"student\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-9-30 09:56:52"}
{"_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": "ursqhXgurBpkdPocw", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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, t : Teacher | some g : Group, c : Class | \n  \t\t(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": "KMy8kngwk6uAtJqZF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:48:03"}
{"_id": "EpAgTrQNFN9ptmJxR", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, g:Class.Groups | g in c.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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jM38ZNQb6YgZvgmbC", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 15:05:14"}
{"_id": "GaEabTzQQLxT4fSR6", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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\n  \t\t| (some p : Person, g : Group | c->p->g in Groups) implies\n\t\t  (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": "feuL3vvZkoKTjLuKM", "msg": "The name \"g\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 21:08:31"}
{"_id": "LGDytQ2JayKjbqyi7", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  some x : Class, p: Person, g : Group | x->p->g in Groups implies (lone t : Teacher | t->p in Tutors | p in Student)\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "ixhopsPCwcDs2cqWo", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:58:26"}
{"_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": "c6ShJC8ZMWkGDnMtd", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall 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 Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | some p:Person | some g:Group | c->(p->g) in Groups and 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": "d725ug3TZr2SPvv5z", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:52:26"}
{"_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": "HzLNtyegPycivWDMz", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, g : Group, p : Person, 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\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\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KCwvDZCdMsX8fawYH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:08:32"}
{"_id": "KrfDNvQREz4rEFwyb", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 c:Class | some t:Teacher | t->c in Teaches) and 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": "2n6deotAr4gfCWgbC", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:29:09"}
{"_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": "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": "JppCw9i4ntpYjhfEN", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->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\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x 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": "wAHEsQhb5fXHQ45qZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:44:31"}
{"_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": "AMWFazFtsWSqWJDhi", "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 { 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": "fBm8wkPHjqYe5uRqj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:38:56"}
{"_id": "E9s4gRZqrD49vpTtW", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x not in Teacher\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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all 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": "kZh9wP88Qdk5eMJCj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:08:05"}
{"_id": "PkZxDRFGxi9Firvtb", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  \n\tall s :Student|some g:Group | g in Class and 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": "YvqAYKcSmADfzHHSq", "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": "2020-10-27 12:19:55"}
{"_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": "Jv2HJX4yFjH5v9t8w", "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\n/* Some persons are 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\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\t\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\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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p in Teacher and s 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": "f3DAkG73bphg6zZJw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 12:47:15"}
{"_id": "Yoiri56KrqgqcDyej", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 (Person-Student-Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t:Teacher | some t.Teaches\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some( c.~Teaches & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t:Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EwtErnyXXskQNzHCw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 18:21:50"}
{"_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": "myah7x8Y8NstuGJ78", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall c : Class, p : Person | p -> c in Teaches implies 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": "hqJ6W8ZLNSja2Ewi3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 21:03:32"}
{"_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": "KnFJgf6fojR6QFvLf", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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": "u8xqhzcEjth5msL8o", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 11:56:17"}
{"_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": "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": "PRFDKFhQMHtibyQTp", "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 x : Class | (some p : Person, g : Group x->p->g in Groups) -> ( some t : Teacher | t->x in Teaches)\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": "YH3ANm7Y5Qe5dSYem", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:16:29"}
{"_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": "L9iKe7zvEfRhuPbdH", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\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/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Bn4oFnLLKpNZpiArB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:26:54"}
{"_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": "pGLNkLFDHmHm82TAM", "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\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": "F3gMC7PunZbJqokwa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:59:23"}
{"_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": "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": "23ihDZRmvmebJpQMh", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\t\n  \t(all c : Class | some p : Teacher | p -> c in Teaches) and \n\t\t(all g : Group, c : Class, p : Person | c -> p -> g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "cBwwHan7KXJsf9s4Z", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 03:15:38"}
{"_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": "KLowfPS6SLicGXiAn", "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  Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall t:Teacher | t not in Teaches\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7zukxwijbZt7H3pQi", "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-6-14 22:49:39"}
{"_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": "5hcyiLeudDo8Hdvsh", "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, 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 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\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 p : Person, c : Class | (some g : Group | c->p->g in Groups) implies (all t : Person | t->c in Teaches implies 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\t\n}", "derivationOf": "4DCdKDrikNugRtPZN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:46:15"}
{"_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": "PyEjiwDoKBZbQZC8o", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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  \t\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": "uJ9spciykq2EN4r72", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 01:39:22"}
{"_id": "vtTTHvmBtmNjRkXtm", "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, 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 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\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 p : Person, c : Class | (some g : Group | c->p->g in Groups) implies\n  (all t : Person | t->c in Teaches implies 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": "WACbEQ7XmB42mmWnM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:38:35"}
{"_id": "inmKpDxy6JEgs3yth", "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 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\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": "trJ3tDRf3epMQFNG7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:01:41"}
{"_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": "4FECGM4pjKLfgbsSb", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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": "vaEtRCt9xyfHSJfyC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 20:59:17"}
{"_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": "6Bg9ptyMy7oRQdM7L", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n    \n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "rLPxcCfgCREEphxg3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:48:26"}
{"_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": "uen4TtmacMdeMsmg7", "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, 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\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": "XnGA4sZK9tBBQY3f3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:05:47"}
{"_id": "irnr5PbrKAQAg7taN", "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": "i23hGipndA86inx4t", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:14:16"}
{"_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": "qCEpjyYr8Q8YScXDP", "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 f : Person | f in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall f : Person | f not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall f : Person | f 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\tall t : Teacher \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class, 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": "ae3MMNEwbbfpFR4Sg", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:09:38"}
{"_id": "m8872WBrzfXNcRz9K", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 p : Person | some t : Teacher |  (some c : Class, g : Group |   \n  \t\tc -> p -> g in Groups and t -> c in Teaches) implies (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": "zFgDPFRtf7uStA4Dm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:04:41"}
{"_id": "WWERt9L9XA6uwx6kn", "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": "Bi6CgG3g3Evs4KCzn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 13:14:22"}
{"_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": "rmo7nAPmjWPmqaMuK", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "fipM4QrCXNBKCdvv6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:18:41"}
{"_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": "iLGRxLM6NNwurYELa", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n  all ps : Person | some c : Class, some g : Group | some t : Teacher | c->ps->g in Groups and t->c in Teaches implies t->ps 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": "YWXG2tkPamiSEEqFS", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 11:30:52"}
{"_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": "9h47bWopFMuzxE4jN", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 c:Class | some t:Teacher | t->c in Teaches) implies s->t 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": "KS3p7CJwW85wH6D4G", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:04:52"}
{"_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": "QTWroBsJLQt86EqhG", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all p1, p2 : Person | some c : Class | some g : Group | p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->c in Teaches and p2->g in c.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 p1,p2 : Person , c : Class| p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->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": "QzTg8jcfrMo5zCq53", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:16:39"}
{"_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": "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": "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": "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": "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": "ZdeXTWQDT2XczpGxC", "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  all p : 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": "L9wBkeo2Absxrmkq6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 21:20:27"}
{"_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": "DKaSnNGRYYqt89ZcW", "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  all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n  \n  no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n  \tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \n  all p : Person | p in (Student + Teacher)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n  some c : Class ,t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n  all t : Teacher | (#t.Teaches)>0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  \n  all t : Teacher | (#t.Teaches)<2\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  \n  all c : Class | (#Teacher.Teaches)<2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "P78JkpeDofRSExGRq", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:02:13"}
{"_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": "MpwpjynRmXakzh8gq", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tsome c:Class, t:Teacher,g:Group,p:Person | c->p->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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LxuRoNCzKzH8LZj88", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 15:14:38"}
{"_id": "w6vWqEBftBbcBNRSy", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not 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": "cAFXrZpknguEL5f2M", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 20:55:41"}
{"_id": "Cwx2DB6CgvEHFW7BM", "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\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "oLf5vJ8XQi38RTRY2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:32:12"}
{"_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": "6vMvYdqwch6NxE8mB", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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": "bH7yHR9ncEvJ7Xrtc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:12:01"}
{"_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": "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": "CviJaSmpo9sLB9E9u", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches implies (some g:Group | all p:Person | c->(p->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": "yEb8Fa5EpMHQw3Syd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:59:18"}
{"_id": "2MDQ6F4L9giJNJZL7", "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 Teacher implies p not in Student) and (p in Student implies p not in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n  \tPerson = Teacher+Student\n}\n\n/* There 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\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "47iwqetyZQwSvkcCX", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 13:55:15"}
{"_id": "hKzoxX4SQCjmEjPth", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | all c:Class | t->c in Teaches implies (some g:Group | all p:Person | c->(p->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": "yKF8yaEwn9ofihvwj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:00:53"}
{"_id": "pe3NGe4634BNyqQBB", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Teacher | p.Tutors in Student and p.Teaches in 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": "e3HpaZSLfSWqTZzJK", "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": "2020-10-27 15:16:07"}
{"_id": "HGnBHFaZRNA3req6Z", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 (Person-Student-Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t:Teacher | some t.Teaches\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some( c.~Teaches & Teacher) \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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": "NrSGMLedteQqpfaAr", "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": "2021-1-13 18:23:22"}
{"_id": "KawmQAjZp9BT4594M", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | 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": "Wsa9YRRF2e2Xwo4b4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:17:23"}
{"_id": "7YRjdapWGDGshJpyi", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 p : Person, all t: Teacher |  (some c : Class, g : Group |   \n  \t\tc -> p -> g in Groups and t -> c in Teaches) implies (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": "m8872WBrzfXNcRz9K", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:05:03"}
{"_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": "Diw93Z9bLtX7Dhf2p", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\n  \t\t| some g : Group\n  \t\t\t| c->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\n  \t\t| c->p->g in Groups implies\n  \t\t\tsome 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\tall p : Person\n  \t\t| (p in Teacher implies all p2 : Person | p2->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": "w4XdhXQTwZ8B5KBW4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 20:21:40"}
{"_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": "KrdFK33Ngkg2NjvxC", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | some p: Person, g : Groups | x->p->g in Groups implies some t : Teacher | t->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": "y6TjTW67FLGS5MDn6", "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-10-29 09:25:10"}
{"_id": "D2eMEvxbWBrWjfRzR", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | all t, p : Person | (c->p->g in Groups and t->g in Group) implies (t->c in Teaches and t 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  all 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 c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "m6ZegbFaMMcM9NkvD", "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": "2020-10-29 10:18:54"}
{"_id": "mN6jv4TPREy36Tkah", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->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  all x,y : Person | x->y in Tutors implies x in Teacher and y in Studente\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nJhY9o8WZGX8BP3QJ", "msg": "The name \"Studente\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:34:28"}
{"_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": "t4aPjK3AMfgXLGKDX", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 g : Group, t : Teacher |  (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": "54wZHCjxWuFgfmbKY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:15:37"}
{"_id": "DkcpgKwSe5znFRtz4", "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\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tno (Student & Teacher)\n\t\n  \t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t (no Student) and (no Teacher) and no ( 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": "G4TbDqXuAML6Y59DW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 19:44:24"}
{"_id": "8hrP6spw7qHEA4wDL", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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/* There classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t.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": "GBShAFg9yz9G7Y7k8", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:12:22"}
{"_id": "rP9fpqgJvA4oJivHR", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p 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": "PKCnW8DdSro9c7dwy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:20:55"}
{"_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": "hyN22HWXdaDXmbHRN", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t(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\t(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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\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}", "derivationOf": "Ssx2QTszfbh6yrmNG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:15:24"}
{"_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": "4u7wLZZvQXP79u8nC", "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\t(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\t(all 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\t(all 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\t(all s:Student, g:Group, c:Class | all t:Teacher | 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": "2ozYzQt4SGyqrn9EX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:00:26"}
{"_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": "9iK7arnzudQbhagPm", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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/* There classes assigned to teachers. */\npred inv5 {\n\tall t: Teacher | t.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "N7S4Z7LmLEds6t9uR", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:17:15"}
{"_id": "KaGDkKvshRgbztqiC", "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-9-30 10:02:22"}
{"_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": "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": "Au53qBDe3nDWFBPz7", "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 in Student or 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 | 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,t2:Teacher | all 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 | some g:Group | \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "orWNQGvrsfeYWNPnv", "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": "2020-10-29 09:41:27"}
{"_id": "s6FDAfoZwEXJ7eWfZ", "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": "nom8LvyR9ze25dE8F", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 20:48:55"}
{"_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": "CJDCdouN7WCYb5Xiw", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, g: Group, p: Person, 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\tall t: Teacher | some c: Class, g: Group, 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\tall p,pp: Person | p->pp in Tutors implies p in Teacher and pp in 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 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": "hcY8F2Q3cDe28TwTM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:16:43"}
{"_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": "hCmA8usnLCT5qcraa", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, 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\tall t: Teacher | some c: Class, g: Group, 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\tall p,pp: Person | p->pp in Tutors implies p in Teacher and pp in 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: Person, c: Class,  t: Person | t->c in Teaches implies 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": "nvbRKsg6LuHA7dh3M", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:30:15"}
{"_id": "4uRZNosi6d9BJ5Yzp", "cmd_i": 10, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class |some g:Group |some p:Person | c->p->g  implies some t:Teacher t->c in Teaches \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  all 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\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 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "49mCDntEzHpTHk3kH", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:15:55"}
{"_id": "YLu2ZRGxBKvYLkxZt", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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": "Dxe34d7cqZ6nio4My", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:36:36"}
{"_id": "xXLGPin4Z8CTuvGZR", "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\t(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\t(all t : Teacher | some c : Class | t->c in Teaches implies (some p:Person, g:Group | c->s->g in Groups))\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "6uTfxDNpZrk67GqYE", "msg": "The name \"s\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:24:10"}
{"_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": "pPdWDaKfCCjB7Ax4S", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 c:Class | some c.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "S8A8ohdBoQg36Ntyx", "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": "2021-1-12 00:56:40"}
{"_id": "nZCSPJbJyaSaxPFHu", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, 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\tall t: Teacher | some c: Class, g: Group, p : Person | c->p->g in Groups and t -> c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall a, b : Person | a -> b in Tutors implies a in Teacher and b in 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, t : Person, c : Class, 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": "9Rsyrm9QYauaXn7Zr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:29:53"}
{"_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": "wDqysswYseRcYDgKa", "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\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only 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(all 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\t(t->s in Tutos 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\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": "vaJCy9sWp3Q7MjLqc", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:41:03"}
{"_id": "tRZRhbnwMByk8HDxx", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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/* 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\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xqhwiAvAB7oiDAtBc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:03:20"}
{"_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": "TwxN7fD8HkAAmvRaw", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\t\n  \t(some c : Class, p : Person | p -> c in Teaches and p in Teacher) and \n\t\t(all c : Class, p : Person | some g : Group | c -> p -> g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "vsk8wd4KfXdrs3zMJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 03:18:08"}
{"_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": "bGFcSive4KX7mH2xs", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Person | some c : Class, s : Person, g : Group | c->s->g in Groups and t->c in Teaches and t in Teacher\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": "c2aJDxie5qubwqkzj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10: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": "7K57Ma2zfP5JbwrkN", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall 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 Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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": "EbT698uRHurjAkWxv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:54:31"}
{"_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": "nD6JbfmabEYaNQvfE", "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 all 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 Teacher and p not in Student)or(p not in Teacher and p in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HpSowbShmbccGnegS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:46:41"}
{"_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": "36ReDhWJWNKDhJD3f", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "kry4a9e7AHMbgcdJE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:14:55"}
{"_id": "ahFjbP95rPZgoPMnW", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, 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\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/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aHzgbBv98Y243xX5a", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:42:44"}
{"_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": "XJypFc3TWkJHzQ5DZ", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x 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 x : Teacher | some y : Class | x -> y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  \tall c : Class | all t, x : Teacher | t -> c in Teaches and x -> c in Teaches implies t = x\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, t : Student | some g : Group | c -> t -> 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, 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  \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 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": "9uPmea9NjamnGNzKz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:06:03"}
{"_id": "FeWKSHGdyZgJgvCDH", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t: Teacher| (some x:Class | t->x in Teachers) implies some g:Group | t->g in Tutors \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\tall x: Class, p: Student | some t: Teacher | x->p->\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "85CpsBjKFuhZMnnhx", "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": "2020-10-29 10:28:05"}
{"_id": "f9H5rCSJC3mbv8xXw", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher 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\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": "WcAXGXGgjH8QgAWRj", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 23:45:22"}
{"_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": "e5kFMHCvBx4pPPqDY", "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/* 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 in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | implies 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": "7c9GyWK5awXpDo4ax", "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": "2020-10-28 21:22:45"}
{"_id": "7r52hbuoCcdgSNKve", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches implies (some g:Group |all p:Person | 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\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "kRydxXYRvgAyhjMWc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:25:36"}
{"_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": "Q8zaKYnwXMXhDQFha", "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\t(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\t(all 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\t(all 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  (all s:Student(some g:Group, c:Class, t:Teacher | 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": "ZEn5bb4nXCum9EK9J", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:40:15"}
{"_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": "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": "zFgDPFRtf7uStA4Dm", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 p : Person | some t : Teacher |  (some c : Class, g : Group |  \n  \t\tc -> p -> g in Groups and t -> c in Teaches) implies (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": "3W3FX4jNb4ucpRamv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:04:34"}
{"_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": "npBHAdwQLHkoc5rSx", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t: Teacher | t.Tutors.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": "R3Rq3jmoH96oPFHfo", "msg": "This cannot be a legal relational join where\nleft hand side is t . (this/Person <: Tutors) (type = {this/Person})\nright hand side is this/Student (type = {this/Person})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 15:12:01"}
{"_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": "DHyhB6uKsFQsCwPFC", "cmd_i": 13, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tsome s :Student | some c:class | some g:Group | c->s->g in Groups \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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "khcBF6y6qmYYWr26b", "msg": "The name \"class\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:54:18"}
{"_id": "n7TAXc7WwM7ANhwx3", "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  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 { \n     p in Teacher or p in Student\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "k8E7EHtg84m9DrgET", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 18:39:03"}
{"_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": "h2cip5s2mjxrcLzJq", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\tall c : Class, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n  \t\t\tsome t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c : Class,, g : Group\n  \t\t| some t : Teacher | c->t->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": "kZjDo7ykezLZurRGQ", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 20:06:34"}
{"_id": "qzLbcfvamoeB2CjZq", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n  all p1,p2 : Person , c : Class| p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->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": "5qag4LAGL9ZPptvts", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:14:39"}
{"_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": "b3C9TacvfttNmzHB4", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, g : Group | some c : Class, t : Teacher | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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\tall p1, p2, p3 : Person | (p1 -> p2 in Tutors and p2 -> p3 in Tutors) and p3 in Teacher\n}", "derivationOf": "mmqpowxJGphbQ8LBv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 00:05:02"}
{"_id": "6ucZE6YMCobzNB6Pf", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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\tall p1, p2 : Person\n  \t\t| 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\tall p1,p2,p3 : Person\n  \t\t| p1 in Teacher or\n  \t\t  (p2->p1 in Tutors and p2 in Teacher) or\n  \t\t  (p3->p2 in Tutors and p2->p1 Tutors and p3 in Teacher)\n}", "derivationOf": "WFjgMh7PNvhtMkhtP", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 22:02:02"}
{"_id": "4QyB2bsok5836HNxG", "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 f : Person | f in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall f : Person | f not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall f : Person | f 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/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class, 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": "qCEpjyYr8Q8YScXDP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:09:44"}
{"_id": "Pwa9yiWB3a5haWz2c", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group | some t : Teacher | c->t->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\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* 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\n}", "derivationOf": "fvARtKQPojcSHgu2W", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:06:11"}
{"_id": "7ioiprLMKuXZCK37f", "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 Teacher implies p not in Student) and (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": "tbopxmMXFsmRB6YPN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 13:21:23"}
{"_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": "9MY8WZDmoDiX4RfAT", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 | all c:Class | some t:Teacher | t->c in Teaches and 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": "7Dre8ZzkC6X2X7khD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:23:49"}
{"_id": "aX9jL8B9xh3qMA88k", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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\tall p1, p2 : Person\n  \t\t| 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, g : Group, t : Teacher\n  \t\t| 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": "p5QBtniN3Tptjc5Md", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 21:29:28"}
{"_id": "iEJjTMw94DGseiW3S", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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 p1, p2, p3 : Person\n  \t\t| p1 in Teacher or\n  \t\t( p2 in Teacher and p2->p1 in Tutors) or\n  \t\t( p3 in Teacher and p3->p2,p2->p1 in Tutors)\n}", "derivationOf": "oGrwDFjWDRJxRE95W", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:37:19"}
{"_id": "3W9aXBRC9Ly6Xe26S", "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\t(all c : Class | all s : Student | some g : Groups | 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": "YH3ANm7Y5Qe5dSYem", "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": "2020-10-28 22:58:20"}
{"_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": "F3tcKg9ijKhr3PW4j", "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 => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "63BWDSPejGP9tZGZT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-30 18:56:12"}
{"_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": "53QHWNp9XPbmeB8GK", "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  all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n  \n  no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n  \tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \n  all p : Person | p in (Student + Teacher)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n  some c : Class |  c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\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-10-29 09:50:28"}
{"_id": "yRvoMa6JRiq2zG2ph", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, p1, p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student and p2 not in Teacher and p1 not in Student and p1->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": "gHNS7ZAJCBt6S9Sn8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:06:25"}
{"_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": "XiJF3Y7aYFebh3zsR", "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 | 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 | 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,t2:Teacher | all 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\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n   \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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\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": "PN89CWiotB5gECxF8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-4 20:59:21"}
{"_id": "LKSPi3ddADC8ti6mi", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 c:Class | some t:Teacher t->c in Teaches) implies s->t 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": "K8mLdAtbtZcuuR2Ph", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:04:13"}
{"_id": "vqEWGWYiBkBaqyLPe", "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\tall c: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\tall t1,t2:Teacher | all 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": "h9xibP2Gr4hufwkkr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:16:37"}
{"_id": "5bDhttdKJHPQcDfDe", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\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 p1,p2 : Person , c : Class| p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->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": "CkzP5LsXMccSxANzK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:08:22"}
{"_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": "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": "sZpFg2cYNTdEJRnmZ", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall t: Teacher , x :Class | some g : Group | x->t->g in Groups | t->g in Tutors \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": "qfxwdqb3iQiWitFPg", "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-10-29 10:10:13"}
{"_id": "nNNwqXpi8qNzZFhMq", "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 {\nno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nnot (some p : Person | p in Student and p 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 Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7pnpuxTmmzg8Gq5yx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 21:44:44"}
{"_id": "2aNghFCQ5aWNRwvhu", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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": "pYyP5S7wjWdr88XCm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 13:22:54"}
{"_id": "EYjpQiGZotNpGAPRt", "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, 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 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\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 p1, p2 : Person, c : Class | (some g : Group | c->p1->g in Groups) implies p2->c in Teaches implies p2->p1 in Tutors\n\t\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": "nJTGvKc58MkGJifkd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-12-2 17:28:31"}
{"_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": "kry4a9e7AHMbgcdJE", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "Tr4w8nevfp9q8o8C5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:14:52"}
{"_id": "m3pFCWRFRwu84jd76", "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 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": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:25:12"}
{"_id": "HrKp5tywokg4vS8mk", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(all c : Class, s:Student, g:Group | c->s->g in Groups implies all t:Teacher | t->c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "HZys8YWrFQcQyn9oC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:04:03"}
{"_id": "7pnpuxTmmzg8Gq5yx", "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 {\nno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nnot (some p : Person | p in Student and p 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 Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "u6ZR3mrZrXFdusHZK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 21:44:15"}
{"_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": "Si2XvWnwt988B83mi", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, g : Group, p : Person, 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\tall t: Teacher | some c: Class, g: Group, p : Person | c->p->g in Groups and t -> c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall a, b : Person | a -> b in Tutors implies a in Teacher and b in 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, t : Teacher | 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": "cZvCsnjw8F4njvnwr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:14:49"}
{"_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": "Bn4oFnLLKpNZpiArB", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher, g : Group | some c : Class | 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": "opXGm73frHydJ7789", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:26:25"}
{"_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": "DQxGEES2p78pnSEbg", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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 p1, p2, p3 : Person\n  \t\t| ( p1 != p2 and p2 != p3 and p3 != p1 ) implies\n          ( (p2->p1 in Tutors and p2 in Teacher) or\n  \t\t    (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher))\n}", "derivationOf": "tc7CM9SG98fFB92Xp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:45:09"}
{"_id": "SGgA26i2gcxGttCLS", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NajQMLFyeCX3kTiS7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:51:18"}
{"_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": "rer7qvFg6ND3yKW7a", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some c.Groups) implies (some (Teacher & c.~Teaches))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some (t.Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n  all p : Person {\n  \t(some (p.(~Tutors) & Teacher)) or\n  \t(some (p.(~Tutors).(~Tutors) & Teacher)) or\n\t(some (p.(~Tutors).(~Tutors).(~Tutors) & Teacher))\n  }\n}", "derivationOf": "dNBqjuM6BE2S6tyjJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:11:45"}
{"_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": "8xgLHiB9CaiABRZ8J", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\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": "HZR83KBGMysEsyZo6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 22:33: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": "gMzT3FjFWkGLakxC5", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group | 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": "qD2odTRWnt93dC6zQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 19:00:17"}
{"_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": "JWKiKghT7LnNAwvam", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "DWfL8EstZPhX2N4oP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:33:08"}
{"_id": "wS5g2vaPSzxmPJCP2", "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 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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all x : Class | some p : Person, g : Group . x->p->g in Group implies some t : Teacher | t->x 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": "NtJ87bQowakBzgbhD", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:39:04"}
{"_id": "pYgjHF9e6gn69WA9z", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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 \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vjnhAuZQm6bX6BfMu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 22:20:39"}
{"_id": "pLC7P92b3Ai7JjZuP", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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\t(all s:Student, g:Group, c:Class | some t:Teacher | 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": "tHBniXay6kd9pECyA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:52:57"}
{"_id": "FW6s5zSKpyZY3RsH2", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent = Person - Teacher  \n  \tTeacher = Person - Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\n\tall x : Person | x in Student or x 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": "7Da5PsQqP3EXH4iyM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:09:18"}
{"_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": "9oNntZ9QXsnnWDgNX", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall 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 Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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": "7K57Ma2zfP5JbwrkN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:54:42"}
{"_id": "kcNXjBDs8uwMqxKmB", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all  c : Class, s : Student, g : Group | some t : Teacher | (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": "w8B9aGWzTv9gamBP8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:00:14"}
{"_id": "GNSNfTJPFHkDDHH3o", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n  all ps : Person | some c : Class, g : Group | some t : Teacher | c->ps->g in Groups and t->c in Teaches implies t->ps 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": "iLGRxLM6NNwurYELa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 11:31:08"}
{"_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": "APtC8BgKyyLNStwrn", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Rt6LxZbmFDrCgTwNg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:31:37"}
{"_id": "BZo5PBawj5ihNtWMg", "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\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n  no (Student & Teacher)\n  \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\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "D6fehfQKXrMXpfthK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 19:40:48"}
{"_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": "CwcPkNKjGvf87CpYw", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:15:34"}
{"_id": "uhTv8dWtLivAj6mY7", "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 p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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 t : Teacher | some c : Class, s : Person, g : Groups | t->c in Teaches and 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": "jBkXC8mQGhs5R6d88", "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-10-29 10:19:58"}
{"_id": "NsWMQxnh48ibGALHm", "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/* 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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  all 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": "jFhF9PiiPZsM7epMJ", "msg": "The name \"TEacher\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:15:54"}
{"_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": "tPt5T9d28ARqW3gRP", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 | t.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": "bAFPhqJTRQiMBS4DF", "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-10-27 14:33:46"}
{"_id": "i3n3bZYAqPfYbNKEX", "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  some p: Person | p in p.Teaches\n}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KPzY68mxmY2tkZFsX", "msg": "There are 1 possible tokens that can appear here:\n}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14: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": "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": "ccHK5kXJsgRL3Fpxw", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 | all t: Teacher | t.teaches.c\n}\n\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8PRTGX2cvwqTqzz5T", "msg": "The name \"teaches\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:36:10"}
{"_id": "7GkbSmbi6oFDb5aJw", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "2tCeEA4dfRaBYCijR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:18:15"}
{"_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": "ubz4tuJBNzdcx5iCY", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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\t(all s:Student, g:Group, c:Class | some t:Teacher | 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": "p9ifcS7HSJWdo8Fo5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:56:23"}
{"_id": "CbnJbdXf9sDLiiGjX", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Xq794qDXGeSHnhyMr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:38:00"}
{"_id": "ofQ86egGWRojd7vKt", "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 p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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  all t : Teacher | some c : Class | some g : Groups | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all s : Student, c : Class, g : Group, t : Teacher | (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": "cuc2HzqpktTrvFa58", "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-10-29 09:54:42"}
{"_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": "6p5twDop9BPX42kXP", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tsome g: Groups | lone t: Teacher | t.Teaches in 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": "2scmq3HTSnsTdJCh8", "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": "2020-10-27 14:53:51"}
{"_id": "yJfereCR38nBKrbEv", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tsome c: Class | lone t: Teacher | t.Teaches 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\n}", "derivationOf": "wbrDZ6J4FBBR5wvif", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class}\nRight type = {this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:54:40"}
{"_id": "iWnpAaMuBgvkKQyNw", "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  all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n  \n  no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n  \tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \n  all p : Person | p in (Student + Teacher)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n  some c : Class | all t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "53QHWNp9XPbmeB8GK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:54:55"}
{"_id": "z58cCTJkqvcmSBJbk", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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  some c:Class ,g:Group ,t:Teacher| all s:Student | 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": "89otrBc2aafnT37ch", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 14:14:26"}
{"_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": "vPpcrvgRvm524zjXf", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Person -> Group | some t : Teacher | c->g in Groups implies t->c 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 p1, p2 : Person{\n    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": "KLtvEpzZXgMEkncfT", "msg": "Analysis cannot be performed since it requires higher-order quantification that could not be skolemized.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:32:41"}
{"_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": "Nefw9j9PEs8iShgH3", "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 {\nno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nnot (some p : Person | p in Student and p 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 Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall 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 {\nall 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 {\nall c : Class, s : Student | some g : Group | 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": "qWNNFPoWr4R7qaTN7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 21:51:33"}
{"_id": "qiE4kbo4azf5H6gG5", "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\t(all s : Student | some g : Group | all c : Class |  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": "wztvtsQDnQAHLzPjQ", "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-10-28 23:00:46"}
{"_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": "mESyY99rYfzuWPdQS", "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\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = empty\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ytvsFKQwgmb7RqWWX", "msg": "The name \"empty\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:54:02"}
{"_id": "6wucCskSSpNwGRrty", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  some x : Class, p: Person, g : Group | x->p->g in Groups implies (lone t : Teacher | t->x in Teaches)\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "c7pQKWvJSbffMuqw3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:54:26"}
{"_id": "e3Wq5AM9DQwQAK5Pv", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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 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": "bwAkcER3zAzheE2Jf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 22:22:17"}
{"_id": "PsH3GvnLJhx6co43J", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\n  \t\t| some g : Group\n  \t\t\t| c->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\n  \t\t| c->p->g in Groups implies\n  \t\t\tsome t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher\n  \t| some c1,c2 : Class, g1,g2 : Group | c1->t->g1 in Groups and c2->t->g2 in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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": "brhdjtQchz35f5Ave", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 20:38:49"}
{"_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": "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": "mFauMorYkS2juzQhp", "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 => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher | t->Group 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": "3aY7ZzYZoFt9QrT7C", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-30 19:06:41"}
{"_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": "GaEYP4mxw7cQjN6CB", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 c:Class | some t:Teacher | t->c in Teaches and t-> 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 p1,p2,p3:Person | \n}", "derivationOf": "8da9nRXZ5rqpXDN2n", "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": "2020-10-29 10:13:25"}
{"_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": "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": "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": "iGZc5uMv6tQQdCfAw", "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  \n  all s : Person | s 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  all p : Person | no ( p in Student & p 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": "ELWtivLCbrWxedrMi", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 19:36:58"}
{"_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": "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": "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": "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": "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": "8DAkHpQCNR4mkJauL", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (some t : Teacher | t->c in Teaches )\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\tall t : Teacher\n  \t\t| some c : Class, g: Group, s : Student  | t->s in Teaches implies c->g->s in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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\tall p1 : Person | (p1 in Teacher) or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher) or\n\t\t\tsome p3 : Person | (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher)\n\t\t)\n  \t\t\t\n}", "derivationOf": "NASnvBzPZrWydBqxq", "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-10-29 09:26:39"}
{"_id": "HtmGb24xjDgKNveuC", "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\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "BTPEoAs7avjqWtgNW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:14:15"}
{"_id": "j5jzLrNy5m6vHSaeL", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Person | some c : Class, s : Person, g : Group | c->s->g in Groups and t->c in Teaches and t in Teacher and s in Student\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": "87P3eyGpRqHGsndRE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:09:38"}
{"_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": "4Qyi6sfzrWRBb7jZX", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall 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 Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s,t:Person | all c:Class | 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\t\n}", "derivationOf": "RBdYnoMYzi3kr6zkG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:48:07"}
{"_id": "weEduCXvGnszuXeqR", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall t:Teacher |some c:Class | t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Person |some c:Class | (p in Teacher and p not in Student) 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": "jG5hYYDBERzucawC2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 11:54:39"}
{"_id": "8fBpcrDiMPnpuAfSo", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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  lone t: Teacher | some g: Group | some c: Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t: Teacher | all s: Student | t->s in Tutors and (not s->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": "wG5EJWmqPfYK9nGst", "msg": "This expression failed to be typechecked line 109, column 56, filename=/tmp/alloy_heredoc3336134615688391107.als", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:52:17"}
{"_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": "Sn8bHEDppFMZ8gKf2", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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": "reEGXyJ9Z2iQAeRQD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:53:18"}
{"_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": "6NG5mr2kXXNFFKf33", "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 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  all t: Teacher | some g:Group, c:Class, s:Student | c->s->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": "hLREyRZLkdMf956BC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-4 22:46:09"}
{"_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": "2S5sD2BA5mvLdj46b", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n  all t : Teacher, c : Class  | t -> c in Teaches implies (all p : Person, g : Group | c -> p -> g in Groups)\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "MWF3thfdyMLSgw5qr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:19:06"}
{"_id": "w99sjBH67Py9NZ7YZ", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some g : Group | t->g in Teaches\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies p1 in Teacher and p2 in Student\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "x35HJE5ba244YexiZ", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:28:31"}
{"_id": "tCSg577xwy7zCJQyi", "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\t(some 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\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": "J6m3AKhRraj9cATZj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:36:01"}
{"_id": "M5p9zSsTpngFJK5Jm", "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 Teacher implies p not in Student) and (p in Student implies p not in Teacher)\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 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\t all c : Groups in Class, s : Student| some g : Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uEKjHsH6eo5c8AqSw", "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": "2020-10-27 14:06:28"}
{"_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": "9GoZNixvEDdXBx6g6", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n  all ps : Person, t : Teacher | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps 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": "baFcuCvsCNhJBdd7R", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 11:41:15"}
{"_id": "m4hiDS52Tp2BNnJMB", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2FfQEkY8AZFWovSuS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:12:33"}
{"_id": "9qxYdSXTaAPwJL3eP", "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 {\nno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HuaBRySjdwTbZrpjP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 21:38:42"}
{"_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": "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": "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": "RDrykmNnrvvobWmfw", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student | some g:Group,c:Class | c->s->g in Groups implies (all t:Teacher | 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": "Eh92PC85RJJ3PGuo2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:28:34"}
{"_id": "ZTuJZBsrepMWhMmvA", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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 p1, p2, p3 | p1 != p2 and p2 != p3 and p3 != p1\n}", "derivationOf": "H6r5qA5Jgzq8ua8dT", "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-10-29 09:51:21"}
{"_id": "938cNbm3oS3dyevjv", "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 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | some t:Teacher |some g:Groups| g in c 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": "vCeXYQ6GbTLkjHQbA", "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": "2020-10-27 12:37:56"}
{"_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": "7GLQpta9QjMe7q4Hn", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zNavqr9nMo94GoTaJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:16:38"}
{"_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": "kZh9wP88Qdk5eMJCj", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x not in Teacher\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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all 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": "iJmtMR6Lh7wc4q7aT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:07:59"}
{"_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": "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": "Cj8xspSMWXmRi7RHL", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->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\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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JBBiN34mXMtHwJoxe", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:44:20"}
{"_id": "CqEADwQ8Jsd4tys5j", "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": "2020-11-1 18:49:37"}
{"_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": "Xugti2BoHNjbAq8fC", "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 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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   all t:Teacher | all c1,c2:Class | t->c1 in Teaches  implies t->c2 not in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2: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": "dfqKT86a929qEgD3F", "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": "2020-10-27 12:07:06"}
{"_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": "LXq9nj8gSjuSdjMFt", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\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 -> p1 in Tutors implies (p1 in Teacher and \n      p1 not in Student and p2 in Student and p2 not 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": "4ZoKitAc8Qi5Jazet", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 22:46:48"}
{"_id": "8RMsNXtLnuqwLpnG8", "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 p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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, g : Group | some p : Person | c->s->g in Groups and t->c in Teaches and t in Teacher 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": "uhTv8dWtLivAj6mY7", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:21:30"}
{"_id": "JoNXaXfKNJzGh3BFa", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  all x : Class | some p: Person | lone g : Group | x->p->g in Groups implies (lone t : Teacher | t->x in Teaches)\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "sieMATwDb4yZnnAga", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:52:17"}
{"_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": "Nejoh6aEGdvMuoYNG", "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 p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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 | (some g : Group | c->s->g in Groups) implies (all t : Teacher | t->c in Teaches and 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": "5EQdx6DbCgj32FHx5", "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-10-29 10:35:31"}
{"_id": "gtBdFgEHquDCMeeDe", "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 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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, 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  all 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": "PdTMhJhoB8aGnXECg", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:11:35"}
{"_id": "kSe7inQSjZyhHhTDF", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 c : Class, g : Group, t : Teacher |   \n  \t\tc -> 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": "pzh25E5u8tgtC3NtR", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:06:55"}
{"_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": "HpSowbShmbccGnegS", "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 all 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 Teacher and p not in Student)or(p not in Teacher and p in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "P3dxYwCcvJbJQKbLB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 23:46:39"}
{"_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": "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": "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": "fvX8suc5cD2b5ja8e", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher implies c -> p -> 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\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": "f9H5rCSJC3mbv8xXw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:45:30"}
{"_id": "tDgAdzLGiWo9yJpfr", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group | some p : Person | c->p->g in Groups implies (p->c in Teaches and p in Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all s : Student, c : Class, g : Group | some t : Teacher | (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": "nNjWmodAKiEh8k566", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:44:17"}
{"_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": "Bgt7TSmwDcGrAFmKs", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "YfbmTsqareMHMyvRi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:19:21"}
{"_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": "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": "mTuPwaZTBs8giLf8h", "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, 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 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\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 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": "zAW5n4MyKTqKQKJ3b", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:24:28"}
{"_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": "WGs5PjbjKyLsKk2NL", "cmd_i": 11, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class t->c in Teaches implies (some g:Group |some p:Person | 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\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "YdAzzPDTA5wSEMsjY", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:25:16"}
{"_id": "fxHrzKxc8HPi4Ltuk", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | all  c: Class | some g: Group | c->t->g in Groups implies p in Teacher and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "42tzacdHdCL9CWEYM", "msg": "The name \"p\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:23:27"}
{"_id": "uXy6TCLuDgsEKqMZH", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p in Student 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": "sjCZWy2Qxxfj4A9HL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:19:22"}
{"_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": "JMXcp4MRnPnFnMNos", "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\tno Teacher\n    \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in Student & Teacher\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yXNFeZgnmpS4CuBDK", "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": "2020-10-27 19:39:18"}
{"_id": "gyQZwzHXjfE4ACjNZ", "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 f : Person | f in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall f : Person | f not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall f : Person | f 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\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Z7NjhxdHoNGffGgbC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:25:24"}
{"_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": "M6JBhFrz6bj8DKsoi", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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": "Sn8bHEDppFMZ8gKf2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:54:10"}
{"_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": "gj5yLCW9BrLe5JFk3", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \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  all 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  all c : Class, s : Student| some g : Group | some t : Teacher | ((c->s->g in Groups) and (c->t->g in Groups)) 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": "APr8Gg2a9yo7mwvEo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:37:25"}
{"_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": "NcgCi6vaBCPFReNc7", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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 t : Teacher, g : Group | 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\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": "NLxCJao4a2PHs8Gmo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:40:44"}
{"_id": "3CE4Jz7DKmwDn4tN2", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tall s :Student | all c:Class | some g:Group | c->s->g in Groups and (some t:Teacher| t->c in Teaches implies t->s in Tutors)\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "Eq8z4JygGYqomJDwF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:10:01"}
{"_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": "iCWdGHtiyDb2RTnJC", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  always Person in Student implies Person not in Teacher\n  always Person in Teacher implies Person 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 Class -> 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": "Z3QerQrMSToEZqGMo", "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": "2020-10-28 15:06:00"}
{"_id": "uJ9spciykq2EN4r72", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, g : Group | some c : Class, t : Teacher | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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\tall p : Person | some p1 : Person | p -> p1 in Tutors implies p1 in Teacher\n}", "derivationOf": "iyo7ufACJeDpWpNiq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 00:10:46"}
{"_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": "XSBkX2cDXv36o7cKi", "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  \n  all s : Person | s 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  no (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": "iFZQ2BfipB8ZiseJG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 19:50:55"}
{"_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": "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": "88Lo7AZ4sHpnSqFxr", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tall s :Person, c:Class | (some g:Group | c->s->g in Groups) implies  (all t:Person| t->c in Teaches implies t->s in Tutors)\n  \n  \n\n}\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 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "yWNxBqW9jLSu2YJAp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:25:36"}
{"_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": "eHdwZv3sEn82th3ML", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p : Person, t : Teacher, c : Class, g : Group\n  \t\t| (c->p->g in Groups and t->p in Teaches) implies 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\tall p1 : Person | (p1 in Teacher) or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher) or\n\t\t\tsome p3 : Person | (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher)\n\t\t)\n  \t\t\t\n}", "derivationOf": "ZP6yFzKS5KrvG9G8N", "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-10-29 09:31:07"}
{"_id": "z5HHukBGdKHuyRmSE", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno 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\tall x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n  \tsome c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher | all c : Class | all d : Class | x->c in Teaches and c!=d implies x->d not in Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t : Teacher, y : Teacher | all c : Class | t->c in Teaches and y->c in Teaches implies t=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | s->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": "ddiFauBZPoKTSwBcy", "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-10-29 10:41:19"}
{"_id": "yzK9kFmBY3tMef5qa", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall p:Person | c->p in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Person | all 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\n}", "derivationOf": "rs8gGQniphT95S7jX", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:43:07"}
{"_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": "9pozYRXruCFrZ2hzi", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some p : Person | all t : Teacher, c : Class {\n    t->c in Teaches\n  }\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CbnJbdXf9sDLiiGjX", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 18:42:29"}
{"_id": "YKy8LYsKdapW3xqbn", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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\tall p1, p2 : Person\n  \t\t| 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, g : Group, t : Teacher\n  \t\t| t->s in Tutors and t->t 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": "KYZEyLEzbBbtSwETH", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 21:31:29"}
{"_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": "STQx8W4fBwY53Tatc", "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/* 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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Person | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->g in Groups)\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, g : Group | some t : Person | c->s->g in Groups and t->c in Teaches and t in Teacher and s in Student 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": "j34iPpwA5Fxw4KWsM", "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-10-29 10:14:56"}
{"_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": "9yJWFC7DmWQzAohQz", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group | some p1, p2 : Person | c->p1->g in Groups implies p2->c 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 p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "37KBiEwwWiDTYXtCF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:12:55"}
{"_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": "7nEphmwWZPR2uQ9Av", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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 t : Teacher | some c : Class, s : Person | t->c in Teaches and (some g : Group | c->s->g in Groups) and 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": "cxYPQ6iwjcRQE2MHq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:18:52"}
{"_id": "tEKZzNboR4H7ifeHH", "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 Teacher implies p not in Student) and (p in Student implies p not in 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\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": "bmYbHamkmZWCfGo5g", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 13:31:05"}
{"_id": "RBjZDchdWyzZfQBQW", "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\t(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\t(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\t(all c : Class, t : Teacher | t->c in Class implies some g : Group, s : Student | 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\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": "NR4DQjBogZ9RSQMkm", "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": "2020-10-29 09:24:14"}
{"_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": "HhjKvbquPXBCxvAAR", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "n3m2wvjrTX8Trd9FB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:15:02"}
{"_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": "LR5THFY3S84nrtTPD", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\t\n  \t(all c : Class, p : Person | p -> c in Teaches and p in Teacher) and \n\t\t(all g : Group, c : Class, p : Person | c -> p -> g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "ZRc6vFxGY5pk27rBm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 03:16:40"}
{"_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": "ucEbAqJ48gZZ7osKw", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xbjpsBFD65fEyzQH5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:32:52"}
{"_id": "d9ZeMfLnMaxiGgatv", "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  \n  all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n  \n  no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\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": "pJwLcQGi9474Abvtk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:33:26"}
{"_id": "jsNFr2osxR4xmz5Ck", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | some 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 p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5TzLMFMBJbTb9qadB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:20:01"}
{"_id": "yaiswyMwS9r7NaLCR", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student, 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/* 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, g : Group | some t : Person | c->s->g in Groups and t->c in Teaches and s in Student and t in Teacher 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": "ojZHkML9A5fbB3XTw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:57:08"}
{"_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": "mLhexx4YNbF3Nxx2E", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t, p : Person | (c->p->g in Groups and c->t->g in Groups) implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */ \npred inv12 {\n  all t : Teacher, c : Class | some g : Group | (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  all 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 c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iFJDxYjLBxFRosrTa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:25:19"}
{"_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": "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": "6eRSaH8tZjq5wKizH", "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 => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | some c->t->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": "EztqFwasqjTH8ETeu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-30 19:17:31"}
{"_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": "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": "BcCvQk4JiMeGZrjPr", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Li9ax75S6jRyS5ADc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:56:50"}
{"_id": "ctAF666gADgBwR7jc", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(all 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\t(all t : Teacher | all 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\t(all 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\t(all s:Student, g:Group, c:Class | some t:Teacher | 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": "3r2qvP9MK2gfpeMfq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:50:06"}
{"_id": "R6q5ovEKADrguB3Wo", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some g:Group |some 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\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n\tall s:Student,t:Teacher | some g:Group,c:Class | 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": "ARoPy6GFzaWYvxEzt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:27:34"}
{"_id": "va9kDpGhG9Zn38z2g", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->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  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": "mN6jv4TPREy36Tkah", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:34:36"}
{"_id": "M5tx6aWtr7fWtEeBD", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher | all c : Class | some d : Class | x->c in Teaches implies c!=d and x->d 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": "kKzxgqko3PRfgKsJR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:27:03"}
{"_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": "NASnvBzPZrWydBqxq", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (some t : Teacher | t->c in Teaches )\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\tall t : Teacher | some c : Class, g: Group, s : Student | c->s->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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\tall p1 : Person | (p1 in Teacher) or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher) or\n\t\t\tsome p3 : Person | (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher)\n\t\t)\n  \t\t\t\n}", "derivationOf": "seByf8g6YBWS2EGrE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:25:24"}
{"_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": "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": "itqjeRjfyaRRtrxsd", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, g : Group | some c : Class, t : Teacher | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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\tall p1, p2, p3 : Person | (p1 -> p2 in Tutors implies p2 in Teacher) or (p1 -> p2 in Tutors and p2 -> p3 in Tutors implies p3 in Teacher)\n}", "derivationOf": "2f6yTKTJMaZCeM8Ng", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:56:15"}
{"_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": "u4rGyciYLsrGt3BdS", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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": "RjLqLj3e9ZWbGkdG4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:36:32"}
{"_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": "7pubhyTo48QCAb4nJ", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher, 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": "SaxMsW4j465M586ZA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 18:45:07"}
{"_id": "MuhfXkZPeCtgFah8c", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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\tall p1, p2\n  \t\t| p1->p2 in Tutors implies p1 in Teacher and p2 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": "zjQgXT9RHBAJwttw6", "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": "2020-10-28 21:15:23"}
{"_id": "hjyNMdiQaWKLpXyzr", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, g : Group, p : Person | some t : Teacher | c -> p -> 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 c: Class, g: Group, p : Person | c->p->g in Groups and t -> c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall a, b : Person | a -> b in Tutors implies a in Teacher and b in 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": "T7iK6Q4sgTqnAryLb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:11:53"}
{"_id": "xkhmQuxwznG5w6qfc", "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 = Student\n}\n\n/* 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 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  Person = Student + Teacher\n  \tall 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": "LoNqnEfREiBpaC2dH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:08:22"}
{"_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": "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": "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": "TwArtEn8dgceoxugL", "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\t(all 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\t( some 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\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": "wDqysswYseRcYDgKa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:41:23"}
{"_id": "7bx8m89m8Dfzb8W2A", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  Teacher -> Class\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PReiDrJrq4WnmsXdy", "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-10-28 15:23:54"}
{"_id": "MR2a3dHWygKsr7BiZ", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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 | some g: Group | some c: Class | 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": "kjMECRL2y8rmEfqKn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:08:27"}
{"_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": "HZR83KBGMysEsyZo6", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\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": "9uxGu5NuZSGQ5C36q", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 22:32:34"}
{"_id": "KPQf5ETE2SfJLWNnp", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t:Teacher | some g : Group | t->g in Tutors  \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": "Yaa5gdnooeiAKeyu3", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:58:12"}
{"_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": "DJzW4vbMjBbNshEyz", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person -> Studen\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qwv6rPmFYgsh6Ff2n", "msg": "The name \"Studen\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 14:19:18"}
{"_id": "HpKau47ZyKtyStNXY", "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 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 : Student | 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 implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  all x 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": "pgQaqHkyDYKKFyJXm", "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": "2020-10-29 09:28:04"}
{"_id": "nqZnKayvWpXjZGXhi", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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\tall p1, p2\n  \t\t| p1->p2 in Tutors implies p1 in Teacher and p2 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": "wfxuYQyTE9DwLgSq6", "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": "2020-10-28 21:15:07"}
{"_id": "XwoXYd49LWyhn98tn", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student | some g:Group,c:Class | c->s->g in Groups implies (all t:Teacher | 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": "GWxF99Yb4We8mr3CE", "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": 235.6999969482422, "y": 199.20001220703125}, "Class1": {"x": 471.3999938964844, "y": 199.20001220703125}, "Class2": {"x": 707.0999908447266, "y": 199.20001220703125}, "Group0": {"x": 235.6999969482422, "y": 298.8000183105469}, "Group1": {"x": 471.3999938964844, "y": 298.8000183105469}, "Group2": {"x": 707.0999908447266, "y": 298.8000183105469}, "Person": {"x": 471.3999938964844, "y": 99.60000610351562}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "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": "2020-10-29 10:28:27"}
{"_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": "DtDHrTbjfm8qHHKcG", "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": "TuMLQzzfBKr3CJxWX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 19:18:05"}
{"_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": "tKS4Zcu7CJ2LhLEoL", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, g : Group, p : Person, 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\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": "LoKxZWkyD9Zb2Eep7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:08:54"}
{"_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": "urbFoMpnEkRB7Yg5X", "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 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": "jeqHpHykpjyvCR4gy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 19:26:23"}
{"_id": "t33qjfx5gwQSctZbo", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "HhjKvbquPXBCxvAAR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:15:05"}
{"_id": "s82RMCGjzErL43GKi", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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": "YiyZWBjDiFc4cFggQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-12 00:54:18"}
{"_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": "gGcaTjiTnCN4uP4Bd", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (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": "oGipriEK8DMmHmKEe", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:21:21"}
{"_id": "qD2wTxt5iJxzZQBXi", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c:Class, t:Teacher | some g:Group | 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\n}", "derivationOf": "sEJntyjazvMaDXwH9", "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": "2020-10-28 16:05:26"}
{"_id": "D3ojsY42pL4Q8xkF4", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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 p1,p2,p3 : Person\n  \t\t| p1 in Teacher or\n  \t\t( p2 in Teacher and p2->p1 in Tutors) or\n  \t\t( p3 in Teacher and p3->p2 in Tutors and p2->p1 in Tutors)\n}", "derivationOf": "JKx9YywGMi3dh4eQ3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:38:41"}
{"_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": "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": "68qLj4baHKcFWt4Gx", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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 \tall t:Teacher,c:Class| some 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 p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by 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}", "derivationOf": "LNFvydzc7Eduy3D48", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:49:26"}
{"_id": "t25NRtNP4qSq8u8Xp", "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 => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5SR8Q2ArgAwjKQ9BP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-30 22:34:32"}
{"_id": "ZXWrEouA9RtDb5yQJ", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hdJzzCyjKpDyhrESM", "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": {"Class": {"x": 707.0999908447266, "y": 132.79999796549478}, "Group0": {"x": 471.3999938964844, "y": 132.79999796549478}, "Group1": {"x": 471.3999938964844, "y": 265.59999593098956}, "Person": {"x": 235.6999969482422, "y": 132.79999796549478}}, "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": "2020-10-27 15:27:25"}
{"_id": "XoZNELuCmQ5nrLdQt", "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\t(all t : Teacher, s : Student | t->s in Tutors implies 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\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": "tCSg577xwy7zCJQyi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:36:22"}
{"_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": "p6StA8Ax8CWbbRSye", "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 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | some t:Teacher |some g:Group| c->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": "938cNbm3oS3dyevjv", "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": "2020-10-27 12:40:15"}
{"_id": "AL2XnhHQfhsoBsNoh", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group, s:Student, c:Class | t->c in Teaches implies s->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\n}", "derivationOf": "LKW5xkJaNy5vooEJQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 14:41:50"}
{"_id": "gEqet9bw2R244rT5c", "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  all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n  \n  no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n  \tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \n  all p : Person | p in (Student + Teacher)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n  some c : Class ,t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n  all t : Teacher | (#t.Teaches)>0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  \n  all t : Teacher | (#t.Teaches)<2\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  \n  all c : Class | #(Teacher -> c & Teaches)<2   \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "y9Rnvn9GBpkAbM7Ye", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:44:12"}
{"_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": "zf9nGfW5tSsBz8nHG", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->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": "cpe3GnGE5HgRzHrkS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:16:38"}
{"_id": "cZSbrELyL9D8DixD7", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class | some g : Group | some t : Teacher | c -> t -> g in Groups\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall 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\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = 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\tall 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": "X8wcgsoTXaKPC3kR5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:44:59"}
{"_id": "zLzHSzqo2dPC8D6KK", "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 p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Person | some c : Class, s : Person, g : Group | c->s->g in Groups and t->c in Teaches  t in Teacher and s in Student\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, g : Group | some t : Person | c->s->g in Groups and t->c in Teaches and t in Teacher and s in Student 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": "3rK2cP4xkmLgfDyys", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:12:13"}
{"_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": "RSTgdgGAKFzFcAzTZ", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 p: Person | some c: Class | some g: Group | c->p->g in Groups implies p in Teacher and p->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FQxpwkbhSmfe7K37m", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:22:40"}
{"_id": "89otrBc2aafnT37ch", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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  some c:Class ,g:Groups ,t:Teacher| all s:Student | 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": "DQHn3uBdXsovcHzh7", "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-10-27 14:14:16"}
{"_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": "WYE8KhXKopnn3cijc", "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": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:17:10"}
{"_id": "TLhnS4yfPogHMk7KC", "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 { all p : Person | p in Student\n  }\n\n  /* There are no teachers. */\npred inv2 { all t : Person | t not in Teacher\n\n  }\n\n/* No person is both a student and a teacher. */\npred inv3 { all p : Person | p in Student or p in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { 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": "FPRL4ydbBhL9RMEkN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:43:32"}
{"_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": "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": "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": "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": "HzxR2p53TC6Byedu2", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n    all x : Class, s : Student | s in x implies s in Group\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "TFL3z6D4DYbPdnpbo", "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-10-29 09:39:34"}
{"_id": "B7hkAooz5wF8Lukp5", "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 Teacher implies p not in Student) and (p in Student implies p not in 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\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": "tKWXZJ3W2Qg3Nk3k6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 13:46:12"}
{"_id": "sfN6aENoun4mSdSi4", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\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 Teachers and p2 in Students\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DrxWuYvZLjBznzeNJ", "msg": "The name \"Teachers\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 19:03:32"}
{"_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": "fBm8wkPHjqYe5uRqj", "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  { all x.Class | some p.Person, g.Group: x -> p -> g in Groups implies some t.Teacher: t->x in Teaches\n\n}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KaWsYZHnRy7nQWs6c", "msg": "There are 1 possible tokens that can appear here:\n}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:36:36"}
{"_id": "y8SidGi8jCcYhiio4", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | all  c: Class | some g: Group | c->t->g in Groups implies and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fxHrzKxc8HPi4Ltuk", "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": "2020-10-29 10:23:35"}
{"_id": "wztvtsQDnQAHLzPjQ", "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\t(all s : Student | some g : Group | all c : Class |  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": "hiAe2cYCfLj9rgnAE", "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-10-28 23:00:38"}
{"_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": "nus78WpHarM69eect", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 g : Group, t : Teacher |  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": "aeFhLsJWBxpHaY6ap", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:14:14"}
{"_id": "c7pQKWvJSbffMuqw3", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  some x : Class, p: Person, g : Group | x->p->g in Groups implies (lone t : Teacher | t->x in Teaches)\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "3gZmd4sRC8Pg9btfk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:54:06"}
{"_id": "WmKcRidJjhvvWMMMG", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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 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\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/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rpxSmbaEcum7RnKxB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:33:42"}
{"_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": "kdW53RESRTxpvAW3k", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x 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 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\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = 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\tall 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": "YP3NT2ygv8LmNTNtC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:47:17"}
{"_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": "ceRs3fk65qQ5RAdS8", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p in Student and 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": "rP9fpqgJvA4oJivHR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:21:06"}
{"_id": "Mwt9NT4aiN4Pce3Gn", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class, p:Person, g:Group | some x->p->g in Class implies p->g 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": "bH7yHR9ncEvJ7Xrtc", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:15:37"}
{"_id": "sM7pxxYprSyJEtjzL", "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 Teacher implies p not in Student) and (p in Student implies p not in Teacher)\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 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\t all s : Student | some g : Group | 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": "BvS5FDNGDDnCe2Zdf", "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": "2020-10-27 14:02:16"}
{"_id": "a94JuPDKH8yBijduc", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JSHPuapkLousPQGWk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:03:39"}
{"_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": "RCs5LcmBRch7YNnWK", "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\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tno (Student & Teacher)\n\t\n  \t\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 t : Teacher | #(t.Teaches) > 0\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MG9Kp9EL6AuwdfYdd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 19:51:01"}
{"_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": "tzPzvPovNksXYjgtz", "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": "jMQgHhuZTukvtSoK4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 08:58:35"}
{"_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": "9uPmea9NjamnGNzKz", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x 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 x : Teacher | some y : Class | x -> y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  \tall c : Class | all t, x : Teacher | t -> c in Teaches and x -> c in Teaches implies t = x\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, t : Student | some g : Group | c -> t -> 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, 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  \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 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": "uPKzfGkyobEpmPFAa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:04:59"}
{"_id": "NiqmksMFjKcYhHNFp", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, g : Group | some c : Class, t : Teacher | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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\tall p1, p2, p3 : Person | p1 -> p2 in Tutors and p2 -> p3 in Tutors implies p3 in Teacher)\n}", "derivationOf": "XZGRCAEDrQCTmyh5h", "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-10-28 00:03:54"}
{"_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": "o985wBzWR7Fhx6y6A", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "6nSwY4SNtJFpxdNt9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:14:44"}
{"_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": "G9pCLXAbwmzHspJeM", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 (Person-Student-Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t:Teacher | some t.Teaches\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some( c.~Teaches & Teacher) \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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": "sL7G752PcbofW2W8p", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 18:23:54"}
{"_id": "44kgbtsHyj3nHKPse", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some t:Teacher | 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": "49YNTaNjfuFoKNXQ4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 14:30:37"}
{"_id": "SdCwmYcGvhym6bCZJ", "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 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\nall p1,p2,p3:Person | (p1 in Teacher implies (p2, p3 in  Student) )\n}", "derivationOf": "8iPt86KPvyLvmHjSQ", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:47:15"}
{"_id": "hzeifNip9PWERz2Bg", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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, g : Group | some t : Teacher |  \n  \t\t(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": "uy36s2jL4BbqCt4L5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:57:29"}
{"_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": "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": "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": "NHNcvh8aSLTi8Pe6u", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x 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": "YhocyHAGLriRiFcgZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:34:03"}
{"_id": "YTZzvyF3SnvWNm9bY", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class {\n    t->c in Teaches\n  }\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DvqHYsB6Ps9S8aBHG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:43:08"}
{"_id": "WPSgWxWLFTL4fMB5q", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\t\n  \t(all c : Class | some p : Person | p -> c in Teaches and p in Teacher) implies \n\t\t(all g : Group, c : Class, p : Person | c -> p -> g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "C5AWDGFdm7MbKKath", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 03:14:04"}
{"_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": "D4YnqJriunnMHfsdC", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group, p : Person | c->p->g in Groups -> (some t : Teacher | t->c 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 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gvstTdETREXzmefCn", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:14:17"}
{"_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": "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": "YsRbiqQcyYqr6WaLT", "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} th\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\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 | 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 | 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,t2:Teacher | all 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  \tall c:Class, p:Person, 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\t\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\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": "LjgbWQ7Wi3X5Qm6za", "msg": "There are 5 possible tokens that can appear here:\nenum fun let open pred", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-11-4 21:08:51"}
{"_id": "bRfk9u2LsXakzo9K8", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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 | all t: Teacher | some g: Group | all c: Class | 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": "Wq9Au27ys6iRip6CD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:09:34"}
{"_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": "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": "rM8zHCFxJBAsRBSs8", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\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 Teaches and p2 in Students\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "C9u9dtdqPgxevN2bZ", "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-10-28 19:04:24"}
{"_id": "7RbfrDhq9Sntm2yJ7", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n  \tsome 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\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  \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": "rKzNR5gwTxXjhAtdv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 01:53:47"}
{"_id": "NWqikXFmYhYDBSqMt", "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  all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n  \n  no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n  \tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \n  all p : Person | p in (Student + Teacher)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n  some c : Class ,t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n  all t : Teacher | (#t.Teaches)>0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | c 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": "2BRLfeMLJKgThEuJS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:59:02"}
{"_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": "Smc3n8o2W37vxZj5A", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: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": "C62t8ijqeYw9GTear", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2021-1-12 01:00:22"}
{"_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": "pfQZBoaqGfWanTAAE", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, 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\tall t: Teacher | some c: Class, g: Group, p : Person | c->p->g in Groups and t -> c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall a, b : Person | a -> b in Tutors implies a in Teacher and b in 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 : Person, c : Class, g : Group, t : Teacher | 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": "kJDLM4m8cuSftkN7X", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:29:21"}
{"_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": "nKbBwexACQqgnBHZH", "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, 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": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 14:05:25"}
{"_id": "TtuFvbpdHqCTxJGnt", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tsome s :Student | some c:Class | some g:Group | c->s->g in Groups \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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "YdbgemJRrxzSs8AYE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:55:17"}
{"_id": "BRLgoNLobnoc89nq9", "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 => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c->t->Group in Groups\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6eRSaH8tZjq5wKizH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-30 19:17:40"}
{"_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": "igDquNbqAgzEN78aP", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 g : Group  c -> s -> g in Groups) and (some t : Teacher | t -> c in Teaches and 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": "XpsKxcMHB9aHKLuNY", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:21:02"}
{"_id": "Ju6HYRxqmDQ9E7spx", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all p1, p2 : Person | some c : Class | some g : Group | p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->c in Teaches and p2->g in c.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 p1,p2 : Person , c : Class| p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->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": "2aRirzfGgryofwmaR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:16:54"}
{"_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": "2DcWoFTNpfsBazpZ7", "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 | 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 | 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,t2:Teacher | all 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 | 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\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": "rq42tLq4csimCx2Wz", "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": "2020-10-29 09:49:37"}
{"_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": "rCwfFtw8XnzCM5HYZ", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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  lone 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\tall t: Teacher | all s: Student | t->s in Tutors and (not s->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": "HRwB6erjYBsSQtiKs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:54:11"}
{"_id": "RNLrwhW8eLi7iTyJQ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, 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": "Z9WmXbDY3dvNTmHqu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 22:25:27"}
{"_id": "kgHKyf6DsmjBdFC6F", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some t : Teacher | all g : Group | 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": "PsYKthHhC7cmaj8Lo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:12:05"}
{"_id": "FoeQyeM2jQ87R8dG9", "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 and 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\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": "Hqatsj5GnaLGqzeTL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:59:36"}
{"_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": "PcNGRARKLpLZ76TWS", "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  \n  all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n  \n  no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n  \tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \n  all p : Person | p in Student and 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": "MNZAa5kD9rSnDCMMJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:35:31"}
{"_id": "9XXKesFiiT9XbtHaE", "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\n}\n\n/* There are no teachers. */\npred inv2 {\n\n  no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \n  \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "97sc6zvW2S8Em6ZNo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 20:05:42"}
{"_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": "TTj85L9aBJ3RQLrxQ", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | all  c: Class | all g: Group | c->t->g in Groups implies t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tthD3AWztXg9ExZLs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:24:43"}
{"_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": "MQ6j8BWM6GZcGvwfw", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 c : Class, g : Group, t : Teacher |   \n  \t\tc -> 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": "kSe7inQSjZyhHhTDF", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:07:08"}
{"_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": "Xg2BN6zwszqhMrpz6", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t:Teacher | some p->Person | t->p in Tutors  \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": "KPQf5ETE2SfJLWNnp", "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-10-29 09:59:19"}
{"_id": "gCH76mnjYY8kNqvj6", "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 f : Person | f in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall f : Person | f not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall f : Person | f 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": "NudbgoC7KC82byHK5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:50:46"}
{"_id": "kgQdZDBKzB4CQcjkC", "cmd_i": 11, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  implies (some t:Teacher | t->c in Teaches )\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t(all t: Teacher | some c:Class | t->c in Teaches) implies (some g:Group |all p:Person | 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\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "2PHevayqdvuitjGpp", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:41:27"}
{"_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": "ogWdTx9ttbEyCw5en", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 (Person-Student-Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t:Teacher | some t.Teaches\t\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": "fQnnBwe2iNcoabKpr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2021-1-13 17:48:27"}
{"_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": "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": "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": "BTGgJzDYygPBNBCEh", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n/* 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 t, t1 : Teacher t in t1.Tutors || t in t1.Tutors.Tutors \n}", "derivationOf": "ozgMcTFgXnHGFoYCg", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-30 22:39:30"}
{"_id": "m38yi5xLhbrPPbiF6", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\tall c : Class, p : Person, g : Group | some t : Teacher | (t -> c in Teaches) and (c -> p -> g in Groups) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "knCxMp9JQE3NW7mKN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 02:53:36"}
{"_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": "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": "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": "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": "AiKZNXrLEiTE6EcrD", "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 = Student\n}\n\n/* 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 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\tall x : Person | x not in Student and x 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": "mPrgJ67cD6K3f6nyc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:59:31"}
{"_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": "dW2KkRzRkgZiEBrsp", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(all c : Class | some s:Student, 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\t(all t : Teacher, 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "BmH8frhGGYN9kAZyc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:12:29"}
{"_id": "Q6utmNExcvZRAYdub", "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\t(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\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\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": "kkguprQZLtSGabRGn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:10:08"}
{"_id": "tsnP9ZztEzshXfgZx", "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 => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uHtDBZ4o2SXpc4Z62", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-30 21:10:54"}
{"_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": "wbDCtLcnWd48XsvcX", "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 | 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 | not (p in Teacher and 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": "viXduxC7rXDCtisTc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:16:23"}
{"_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": "fZ2F4uPN7vvfJaimu", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\tall c : Class, g : Person -> Group | 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\n}", "derivationOf": "BEtnXi4jvCJhPnNAH", "msg": "Analysis cannot be performed since it requires higher-order quantification that could not be skolemized.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 20:00:43"}
{"_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": "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": "46NDCWcn96iTdDsz9", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 (Person-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": "YLu2ZRGxBKvYLkxZt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:37:02"}
{"_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": "MWF3thfdyMLSgw5qr", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n  all t : Teacher | some c : Class  | t -> c in Teaches implies (all p : Person, g : Group | c -> p -> g in Groups)\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "Xi6wrWuAZAdzDyejT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:18:10"}
{"_id": "G48cByTGakEGabQDi", "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\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall 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 Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s,t:Person | all c:Class | 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\tall t,s1,s2:Person | all c:Class | all g:Group | c->(s1->g) in Groups and c->(s2->g) in Groups and t->c in Teaches) implies (t->s1 in Tutors and t->s2 in Tutors)\n}", "derivationOf": "r49pyA5dPgYQDxSst", "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-10-29 10:40:17"}
{"_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": "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": "xTozYeJR92NDvFrXM", "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 p : Person, c : Class, g : Group | p in Teacher implies c -> p -> g in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall t : Teacher, c : Class, s : Student, g : Group | t -> c in Teaches and 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": "K46LcPWdhwBCJniqu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 14:15:31"}
{"_id": "jrvBLXCp9Au8rSueP", "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 p : Person, c : Class, g : Group | p in Teacher implies c -> p -> g in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | s not in Teacher\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vTC8sfYGSGAFR4bPi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 14:09:24"}
{"_id": "jv6F3dfQ6X6AH2ELo", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, 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\tall t: Teacher | some c: Class, g: Group, 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\tall p,pp: Person | p->pp in Tutors implies p in Teacher and pp in 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: Person, c: Class | some t: Teacher | t->c in Teaches implies 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": "SkLhQeLn5BG7PM3Wa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:29:34"}
{"_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": "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": "XF22yafQrD5a54oCD", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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": "uLN75vk8iMFwueEML", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:34:40"}
{"_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": "m5dtfkmKjihsMv3S6", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "ReotEMb5vENKAJBdT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:25:42"}
{"_id": "CZDsrmE7EqonhxiX3", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, g: Group, p: Person, 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\tall t: Teacher | some c: Class, g: Group, 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\tall p,pp: Person | p->pp in Tutors implies p in Teacher pp in 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": "2m7os9D85YeHhiRwa", "msg": "The name \"pp\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:12:08"}
{"_id": "h9CtXZN3MgZdtomcn", "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 Tacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QTMZ5xi9ZmhFCK32v", "msg": "The name \"Tacher\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-30 18:53:09"}
{"_id": "Gz5t9LPkP4rQPQyZN", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  some t: Teacher | t not in Student and lone t.Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oHksczmuyBo3GfNwZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 14:48:28"}
{"_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": "cZvCsnjw8F4njvnwr", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, g : Group, p : Person, 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\tall t: Teacher | some c: Class, g: Group, p : Person | c->p->g in Groups and t -> c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall a, b : Person | a -> b in Tutors implies a in Teacher and b in 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, t : Teache | 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": "hjyNMdiQaWKLpXyzr", "msg": "The name \"Teache\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:14:42"}
{"_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": "XHpWhFt4a7N7ZPaeg", "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 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n\n  \n  all p1,p2,p3:Person | p1 in Teacher implies (p1->p2 in Tutors) implies (p2 ->p3 in Tutors)\n}", "derivationOf": "H5aBt6cMhot6Pm7Te", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 15:07:12"}
{"_id": "wuEENfXhe4m53R4JG", "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  \n  all s : Person | s 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  all 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": "8d5uosjZpAqi4yR7s", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 19:39:13"}
{"_id": "HuaBRySjdwTbZrpjP", "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 {\nno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nnot (all p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WPSJ2p8fFeLT25yoW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2021-1-13 21:38:38"}
{"_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": "msfamKiQcA56BSTn8", "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 p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, p1, p2 : Person | (p1 in Teacher and p1->c Teaches) implies (p1->p2 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": "HxpLfh6ZXb48F6u3u", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:03:43"}
{"_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": "3PcBoDY3j5mckAsQ7", "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\t(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\t(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\t(all t : Teacher | some c : Class | t->c in Class implies some g : Group, s : Student | 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\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": "RBjZDchdWyzZfQBQW", "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": "2020-10-29 09:25:33"}
{"_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": "4pb9mtrna4MBBAxwi", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not in Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall 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": "SwGizqYPK7P99W5zX", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 19:45:57"}
{"_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": "3yWTGXdv2A2xmxadL", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  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  some t : Teacher | all c : Class, s : Student, 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": "2ipKjuGMwqtshtQYg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:31:26"}
{"_id": "PaBSdWu8MpwPzbYYk", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 | 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": "w42pfwA9Qf7zqxzze", "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-10-28 15:36:04"}
{"_id": "nDPq4N5darEJLa2QX", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 | some t.Teaches c.t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KwRrS5am4pohrWJqw", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:27:43"}
{"_id": "ChDyC5gnW9DM54aJg", "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\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tno (Student & Teacher)\n\t\n  \t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  no Student and no Teacher and no Class and no Group\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5S4vnBst8qKGzH8qa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 20:11:43"}
{"_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": "gBvriZ6xQcwxzLr3e", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all p1, p2 : Person | some c : Class | some g : Group | p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->c in Teaches and p2->g in c.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 p1,p2 : Person , c : Class| p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->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": "2fXWAa9f38wMbWwpz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:16:59"}
{"_id": "AribgWww4v6Sd9hzf", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome x : Teacher | all c : Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->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": "uT7LSd2RSYWFa9aJa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:16:22"}
{"_id": "NdHs4hRjbGBoaTD9j", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pZMLmZbXAFLCdZ5cN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:47:52"}
{"_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": "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": "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": "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": "7TYSDPnXqtud3bjku", "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 | 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 | 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,t2:Teacher | all 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 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\t\n   some c:Class | some s:Student | some g:Group | (c->s->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": "HC5NHHvdm8jZzzpHm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:24:40"}
{"_id": "aS2K55QXi4T5gc6mg", "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 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 | 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,t2:Teacher | all 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\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\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": "XiJF3Y7aYFebh3zsR", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-11-4 21:00:17"}
{"_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": "BjpW4KnDEX9N2aJWq", "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": "2020-10-29 10:06:16"}
{"_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": "w44kyx5zAWLJp4tsY", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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 | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | some c: Class, g: Group, p : Person | c->p->g in Groups and t -> c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall a, b : Person | a -> b in Tutors implies a in Teacher and b in 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, t : Teacher | 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": "Si2XvWnwt988B83mi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:20:11"}
{"_id": "xCZ7RARHHYa8w48Nw", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, t : Teacher | some 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\n}", "derivationOf": "5Khvsdq8jZyKKYjPj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 22:16:04"}
{"_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": "qsaogfXKwk6Nk8GKP", "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\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jL3jEB6iEzr5S8AEk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:58:43"}
{"_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": "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": "jvsxddS88xccdmcN9", "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 => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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": "BRLgoNLobnoc89nq9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-30 19:18:12"}
{"_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": "f58fpevfEoc8geDRG", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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 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\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/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eEhv3hxCWsQ2biLXJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 23:36:30"}
{"_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": "FpmfRaLJ7eHwED2Yb", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some g:Group |some 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\t\n  \tall t:Teacher,c:Class | some g:Group,s:Student | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n\tall s:Student,t:Teacher | some g:Group,c:Class | 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": "avaLFxmJNwy4qa8GN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:39:09"}
{"_id": "Y2SixXF9Wmnvo3AdZ", "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 => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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": "RQFExuvfr2DrNoTP3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-30 19:52:03"}
{"_id": "jo653NxGCcmgXyzjY", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t(some c : Class, t : Teacher | t -> c in Teaches) implies (all g : Group, p : Person | c -> p -> g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "ru5sw3HB5pbjWkskd", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 02:34:14"}
{"_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": "jMQgHhuZTukvtSoK4", "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": "xjARmJdg3s8itd8NK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 08:57:46"}
{"_id": "uqkSJ4xG4dAXuMowE", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some 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": "SpXGP72HQ67Ba8spW", "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": "2021-1-12 00:58:53"}
{"_id": "dnTXu56Hv8GKfkrA2", "cmd_i": 11, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 t in Teacher implies (some c:Class | t->c in Teaches) implies (some g:Group |all p:Person | 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\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "upRzBxEnopHbGEKfD", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:36:36"}
{"_id": "yTyfGjDTZBPn8tkpD", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ucEbAqJ48gZZ7osKw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:47:13"}
{"_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": "zAW5n4MyKTqKQKJ3b", "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, 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 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\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 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": "DSrnvSmvEyYEAAhW7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:24:23"}
{"_id": "87P3eyGpRqHGsndRE", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Person | some c : Class, s : Person, g : Group | c->s->g in Groups and t->c in Teaches and  s in Student\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": "DcT8rLA5vpoZgKgfv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:09:26"}
{"_id": "WDmQwAQT7k9RBesjk", "cmd_i": 13, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tsome s :Student | some c:Class | some g:Group | c->s->g in Groups and (some t:Teacher| t->c implies t->s in Tutors)\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "9xNgkKctz6uj3kuzZ", "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-10-29 09:56:41"}
{"_id": "ay7kYWr5e2Bn8PkR8", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x 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 x : Teacher | some y : Class | x -> y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  \tall c : Class | all t, x : Teacher | t -> c in Teaches and x -> c in Teaches implies t = x\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, t : Student | some g : Group | c -> t -> 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 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": "NZkXhTDkEdff2xBNN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:51:50"}
{"_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": "HWfZaFWSosvhoPL7k", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall x: Person, t: Class | x->t implies x 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": "NHNcvh8aSLTi8Pe6u", "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-10-29 09:40:42"}
{"_id": "civYseZNDBZGucmiX", "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 = Student\n}\n\n/* 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 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\tall x : Person | x not in Student and x 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": "54pYy56jC2GL4m7cr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:58:38"}
{"_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": "guQ6fpkb5eAN68hXB", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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 | (some g : Group | c->s->g in Groups) implies (all t : Person | 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": "r8wM9yvQQwHc86Wkm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:35:56"}
{"_id": "zjs2sMEfMzTt5aWX4", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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    all x : Class, s : Student | (some g : Group | x-\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "D638S8ca9AjMEpt6e", "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": "2020-10-29 09:45:31"}
{"_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": "NzrpNQkuzQ35RLBoB", "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\t(all 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\t(all t : Teacher | all c,u : Class | (t->c in Teaches and t->u in Teaches) implies c=u)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(all c : Class | all t,u : Teacher | (t->c in Teaches and u->c in Teaches) implies t=u) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t(all c : Class | all s : Student | some g : Groups | 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": "KDDxhCmcvuYCLEdPi", "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": "2020-10-28 22:58:06"}
{"_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": "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": "tQQoHbeMTMMvzv4k4", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t, p : Person | (c->p->g in Groups and c->t->g in Groups) implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */ \npred inv12 {\n  all t : Teacher, c : Class | some g : Group, p : Person | p in Group implies t->c in Teaches\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9ASroDBoPXJBNmKCb", "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": "2020-10-29 10:29:20"}
{"_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": "X9YLzRb4Y6BFCEJNa", "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\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(all c : Class | some t : Teacher | t->c in Class implies some s:Student, g:Group | c->s->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t(all 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\t(some 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\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": "Yx7Z6pwx3acwC2kDM", "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": "2020-10-29 09:43:43"}
{"_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": "4NrDeYfFoneudvJKo", "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  all c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | 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": "qKKNaSZzWxhJrADAa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:17:12"}
{"_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": "yWNxBqW9jLSu2YJAp", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tall s :Person, c:Class | (some g:Group | c->s->g in Groups) implies  (all t:Person| t->c in Teaches implies t->s in Tutors)\n  \n  \n\n}\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 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "yX7pdwTS5ruMp4tY3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:22:04"}
{"_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": "QMMs4vfocEfTj8RZ6", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, t:Teacher | some s:Student, g:Group | s->g in 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\n}", "derivationOf": "94LZ4wpmqgQfJBu4q", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 14:27:40"}
{"_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": "6th2s9SruA4kbewjd", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class, g : Group, t : Teacher | c -> t -> g in Groups\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall 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\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = 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\tall 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": "cZSbrELyL9D8DixD7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:46:06"}
{"_id": "vkGs5xoodaZsuAswS", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(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": "6i9voxoixaLLnm7ea", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:22:44"}
{"_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": "8MK6QABvrG2p4Lq67", "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 p : Person, c : Class, g : Group | p in Teacher implies c -> p -> g in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall t : Teacher, c : class, p : Person : t -> c in Teaches and c -> p -> g in Groups implies 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": "jrvBLXCp9Au8rSueP", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 14:14:11"}
{"_id": "6i9voxoixaLLnm7ea", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | 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": "4NrDeYfFoneudvJKo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:17:17"}
{"_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": "PztrHbfej5SSf3kwN", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\tall c : Class, t : Teacher, p : 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  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "G7jvGWQx3hnbdueqQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 02:50:06"}
{"_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": "trzsKsCHgJnP9Hbdk", "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 = Student\n}\n\n/* 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 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\tall x : Person | x not in Student , x 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": "LWp6amdR7edrTg22B", "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-10-29 10:01:12"}
{"_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": "DskWbwEopy6QKCjA8", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 (Person-Student-Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t:Teacher | some t.Teaches\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some( c.~Teaches & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all T:Teacher | lone Teaches.t\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Rw9SX4vxik5boa9i3", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2021-1-13 18:20:45"}
{"_id": "bRrPenRTiNx8kdKZ5", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \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  all 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 , t : Teacher | some g : Group | \n  ((c->s->g in Groups)and(c->t->g in Groups)) 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": "gj5yLCW9BrLe5JFk3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:45:04"}
{"_id": "2tA5tFPxr93GcvRDp", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  \tall s :Student|some g:Group | g in Class implies  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": "sbv3YSwqmS4Ws4vj4", "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": "2020-10-27 12:20:28"}
{"_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": "xxCDvbmPQx7uHZ6wd", "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 p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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 t : Teacher | some c : Class, s : Person, g : Groups | t->c in Teaches and c->s->g in Groups and 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": "7nEphmwWZPR2uQ9Av", "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-10-29 10:19:28"}
{"_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": "SAWzBdh7u6Tm4zGRb", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\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 :> Teacher) || t in (p.Tutors.Tutors :> Teacher)\n}", "derivationOf": "BcpGYXaFJDcE6FYHD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-31 00:07:54"}
{"_id": "8da9nRXZ5rqpXDN2n", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 c:Class | (some t:Teacher | t->c in Teaches and t-> 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 p1,p2,p3:Person | \n}", "derivationOf": "sA7JpwrSnGDqq9Y5S", "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": "2020-10-29 10:13:21"}
{"_id": "3ecS8B2P7MJXEaDZo", "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\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": "dPo7e5LYogFyrZC38", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:53:27"}
{"_id": "FqHepagDDcRFQ6W8k", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some c.Groups) implies (some (Teacher & c.~Teaches))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some (t.Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n  all p : Person {\n  \t(some (p.(~Tutors) & Teacher)) or\n  \t(some (p.(~Tutors).(~Tutors) & Teacher)) or\n\t(some (p.(~Tutors).(~Tutors).(~Tutors) & Teacher))\n  }\n}", "derivationOf": "c8Cs6gzsLuYeDu2bg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:11:28"}
{"_id": "Rdcmws8QpMjPThPHJ", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Person | some c : Class, s : Person, g : Group | c->s->g in Groups and t->c in Teaches and t in Teacher and s in Student\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": "g2oXGdepuhqq7ucG7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:04:05"}
{"_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": "SnMMaiXAjwHutycRz", "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\t(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\t(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\t(some c : Class | all t : Teacher | t->c in Class implies some g : Group, s : Student | 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\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": "fEvxH9YSh8fTeKmRY", "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": "2020-10-29 09:22:46"}
{"_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": "EouBf3DAh4GzMoDbT", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\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 || t in p.Tutors.Tutors\n}", "derivationOf": "TgPhnXBWfWuybvELu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-31 00:06:24"}
{"_id": "5tQKMbejBE33EkRRf", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tNJnSaGgLKqAQbtDT", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:16:16"}
{"_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": "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": "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": "QXz22ZchPt7ZvQkta", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 c:Class | some t:Teacher | 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": "MbZa9FNbB4xCudeqM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:09:44"}
{"_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": "TTF25Ns76HxdvEmQr", "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 = Student\n}\n\n/* 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 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\tall x : Person | x  in Student or x not  Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x : 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": "XjvSM9kpP9mfJsNCr", "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": "2020-10-29 10:07:12"}
{"_id": "Pc9KbKPFMkoH8Wk48", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  all c : Class | t : Teacher | t->c 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": "7bx8m89m8Dfzb8W2A", "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-10-28 15:29:38"}
{"_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": "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": "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": "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": "ruFLuAEotSG87mWMb", "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 all 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 Teacher and p not in Student)or(p not in Teacher and p in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3en7Fzsws3X5RLq7D", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 18:25:36"}
{"_id": "Q6LxnKHeWqbKsSvEs", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n  all p1,p2 : Person , c : Class| p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->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": "qzLbcfvamoeB2CjZq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 19:14:45"}
{"_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": "pQzJQ7vGx3macpaas", "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 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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x not in Teacher\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/* Every class has teachers assigned. */\npred inv7 {\n  \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZbzSGuAaQW3ty22Tq", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:55:01"}
{"_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": "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": "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": "Ptv5yn3D2QrMhYKBf", "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 | 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 | 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,t2:Teacher | all 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\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\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": "NzRr6rsuB7XcpMNtF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-4 20:56:51"}
{"_id": "tnWcxKA6FJqdPQEjL", "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 {\nall c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "feBccusmYrdZEwftj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-18 18:21:35"}
{"_id": "fipM4QrCXNBKCdvv6", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "nvutwWtMRiyrFbkxf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:18:29"}
{"_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": "Aox5us2JwGMbuQYi7", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | c->t in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n\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\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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FWRtWn6MfbiPW6smM", "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": "2020-10-29 09:41:38"}
{"_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": "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": "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": "9999ANsBRvpvFSzAT", "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": "E4RQ4xJWRJ55XGCd8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:25:06"}
{"_id": "cuc2HzqpktTrvFa58", "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/* 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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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  all t : Teacher | some c : Class | some g : Groups | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all s : Student, c : Class, g : Group | all t : Teacher | (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": "eog5aEG6ySHvANW5k", "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-10-29 09:52:32"}
{"_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": "TgPhnXBWfWuybvELu", "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 => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Student.Groups.Group | iden \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "3SM2KdDtkXJiBd8qA", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Student (type = {this/Person})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-30 23:58:53"}
{"_id": "F7Lbe6KHonqsqjH44", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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(some p, p2, p3 : Person | p1 != p2 and p2 != p3 and p3 != p1)\n}", "derivationOf": "bMpMrjmZvJ3q5GxWb", "msg": "The name \"p1\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:53:54"}
{"_id": "H93CYc9THBda96otC", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\tall c : Class, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n  \t\t\tsome t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \tall t : Teacher\n  \t\t| (some c : Class, g1,g2 : Group | c->t->g1 in Groups and c->t->g2 in Groups and g1 != g2)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jkunoZWuEN3baBqq6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 20:10:23"}
{"_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": "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": "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": "s289q9L35foXxcMMo", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 p: Person | p in Teacher implies 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": "rbPjL3woMyjqeNt8P", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:25:31"}
{"_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": "bmYbHamkmZWCfGo5g", "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 Teacher implies p not in Student) and (p in Student 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 Teacher) and (p not in Student)\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": "nJ2rStdGLkoCB2HDf", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 13:30:03"}
{"_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": "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": "ib2pAGub9K83ACZ7w", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all t : Teacher | all 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\t(all 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\t(all s:Student, g:Group, c:Class | some t:Teacher | 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": "ctAF666gADgBwR7jc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:50:15"}
{"_id": "YB8rp2nnhamzsf8Mr", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all 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  all t : Teacher ! some p : Person, c : Class, 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6oiEKbmEdnLnckpz8", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:10:12"}
{"_id": "iJmtMR6Lh7wc4q7aT", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x not in Teacher\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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all 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": "Z8dPBfDhDd5H54AsK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:07:53"}
{"_id": "TGHsgjuJ9g59eJRE5", "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\t\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": "uw8kXzQ5GT6tc5pKb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:02:56"}
{"_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": "HG2KvZzYrJnMqZzPc", "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\tStudent != 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": "gzGwQuhqSMfSLwWmh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-9-30 09:58:04"}
{"_id": "ytvsFKQwgmb7RqWWX", "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 = 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": "pj5ZSrhEvjSyZekS2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:53:49"}
{"_id": "nfRJNmZ7CK9TpJhdw", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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": "FLxaNwE6wRaEGE53R", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 14:13:42"}
{"_id": "4Xj3gdzDfR6trwdxQ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student, 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/* 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": "oFdqwjEbA6Sib7PQq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:47: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": "h76codmLt5Simr3vd", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, g:Class.Groups | some t:Teacher | g in c.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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cDCAzhfdFSeoAyYuL", "msg": "Analysis cannot be performed since it requires higher-order quantification that could not be skolemized.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 15:06:14"}
{"_id": "Li9ax75S6jRyS5ADc", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, p : Person, 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": "RmuiuMMGxmXdTQA5m", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 18:55:47"}
{"_id": "czdGyppieGu7arTZY", "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 f : Person | f 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-10-29 09:35:48"}
{"_id": "u78FbLqWeqNyzwfdX", "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  all p : Person | p in Student\n  \n}\n\n/* There are no teachers. */\npred inv2 {\n  \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": "Li67k43owd9Qwqxzv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-5 00:46:08"}
{"_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": "hghv6NEo9sQDKTebo", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 |  (some c : Class, g : Group |  \n  \t\tc -> 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": "56pyd9EgYmrdvcg8i", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:03:52"}
{"_id": "bn3mgRtm2JZWevCrw", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  lone t : Teacher | some g : Group, p : Person | p -> g in Groups implies t->p in Tutors\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "LGDytQ2JayKjbqyi7", "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": "2020-10-29 10:02:18"}
{"_id": "84N5L2A7cWjcbCNyX", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall 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\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = 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\tall 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": "ZAfysMmLzgFaaG9Lm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:37:47"}
{"_id": "etHTucHns9R4mcrJd", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2PxTPtJF6Wxjpndq3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:32:08"}
{"_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": "zMx9HLZo2CmTF2hJo", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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 p1, p2, p3 : Person | p1 != p2 and p2 != p3 and p3 != p1\n}", "derivationOf": "DQxGEES2p78pnSEbg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:47:53"}
{"_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": "QBgKNHgoRrSKXGJ8d", "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\t(some t : Teacher, s : Student | s->t in Tutors and t->s 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": "T22ZFmNcXW8LxtFZu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:34:01"}
{"_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": "26LcPxs45axfhSC4w", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 p1, p2 : Person, c : Class | (some g : Group | c -> p2 -> g in Groups) and p1 -> c in Teaches implies p1 -> p2 in Tutors) \n} \n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "H8SkEXoSjgbBuQTLJ", "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-10-29 10:23:48"}
{"_id": "bLTihbwrzFCbM9zj7", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (p->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YCLCZzzvHFw99PyxN", "msg": "The name \"p\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 12:30:25"}
{"_id": "e6GCMK39LbCPELHeQ", "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  all p : Person | p in Student\n  \n}\n\n/* There are no teachers. */\npred inv2 {\n  \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": "u78FbLqWeqNyzwfdX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-5 00:46:11"}
{"_id": "LwfdAt4ZfHoztKeTS", "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\t\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: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": "dSPPsZQqveNc5CKx8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:11:06"}
{"_id": "uQTSqcuiPimzThNWg", "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, 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 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\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 p : Person, c : Class | some g : Group | c->p->g in Groups implies\n  some t : Teacher | 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": "r6MnyutYzYeaDuzC9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:34: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": "Wy6Ys7nva9xnpFdZq", "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 {\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": "AA2vRQWasJ4LvR5rC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 11:18:24"}
{"_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": "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": "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": "TpJ2ZSCDmK98S9HC3", "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\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6gp6HSYW34FkTyw4H", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:51:25"}
{"_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": "jzMgZrqjcQwDf987n", "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, 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 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": "AAHv6vHXdg78aCv9c", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:19:36"}
{"_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": "eEmnG8Ym2tDTKJLjC", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x not in Teacher\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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all 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  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": "j4ze45RTh2vhT7Epm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:04:50"}
{"_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": "JC4niXheTNGZud4GA", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (some t : Teacher | t->c in Teaches )\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\tall t : Teacher\n  \t\t| some c : Class, g: Group, s : Student  | t->s in Teaches implies c->g->s in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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\tall p1 : Person | (p1 in Teacher) or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher) or\n\t\t\tsome p3 : Person | (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher)\n\t\t)\n  \t\t\t\n}", "derivationOf": "8DAkHpQCNR4mkJauL", "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-10-29 09:26:44"}
{"_id": "BcpGYXaFJDcE6FYHD", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\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 || t in p.Tutors.Tutors\n}", "derivationOf": "NsETpBoYhmfQcRRc9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-31 00:07:02"}
{"_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": "3r2qvP9MK2gfpeMfq", "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\t(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\t(all t : Teacher | all 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\t(all 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\t(all s:Student, g:Group, c:Class | some t:Teacher | 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": "92GTnLaFA3QAsFg3Z", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:49:45"}
{"_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": "sZoS8qNeMDA8EPi7q", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  all p : Person | p in Teacher implies p in Class\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Q7ESs9begq5ZrGvas", "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-10-29 09:13:25"}
{"_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": "pRnutuQRqZKSiRBTD", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group, p : Person | 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  all p : Person | some c : Class, g : Group | c->p->g in Groups and p in Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4KTuGMzCqTxX55nyf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:18:40"}
{"_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": "MmTzJnLaRe3QzHPXw", "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 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\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": "RM6rngLmaSr7rWjLL", "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-10-29 09:47:04"}
{"_id": "nWf893RQMRWqwkRwt", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  all x : Class | (some p: Person g : Group | x->p->g in Groups) implies (lone t : Teacher | t->x in Teaches)\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "JoNXaXfKNJzGh3BFa", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:53:08"}
{"_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": "JYdGHp2NLrTDAM7fR", "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\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t(all p : Person | p in Student implies p not in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t(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": "DMnmAhec8Xja7jK5N", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 22:41:21"}
{"_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": "y8JYpMCa5CRcEMP4u", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher, c : Class | all 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/* 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": "vEkqCM6FfAn8jRNy7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 01:51:44"}
{"_id": "oLf5vJ8XQi38RTRY2", "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\t(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\t(all t : Teacher | some c : Class | t->c in Teaches implies (some p:Person, g:Group | c->s->g in Groups))\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "qtEnDNi2yJSAFgmHa", "msg": "The name \"s\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:32:06"}
{"_id": "LPaxDGH3yptN3rtKL", "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\t(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\t(all t : Teacher | all 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\t(all 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\t(all s:Student, g:Group, c:Class | some t:Teacher | 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": "dZ4cEjpSNFjRsqHE3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:50:52"}
{"_id": "L4gxoTtCwDPKsDW5y", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t : Teacher | c->t->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\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* 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\n}", "derivationOf": "Pwa9yiWB3a5haWz2c", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:06:24"}
{"_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": "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": "RjLqLj3e9ZWbGkdG4", "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\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": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2021-1-13 17:36:01"}
{"_id": "Zw99mDLEs3F3SEdAT", "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, 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 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\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 p : Person, c : Class | some g : Group | c->p->g in Groups implies\n  (all t : Teacher | t->c in Teaches implies 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": "bN6dAa3DBmf2CHuxz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:37:29"}
{"_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": "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": "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": "grMYxBqQBuWNGBuL2", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JRnXMjd66pMqJGrbA", "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": 314.26666259765625, "y": 199.1999969482422}, "Class1": {"x": 628.5333251953125, "y": 199.1999969482422}, "Group0": {"x": 314.26666259765625, "y": 99.5999984741211}, "Group1": {"x": 471.3999938964844, "y": 298.7999954223633}, "Person": {"x": 628.5333251953125, "y": 99.5999984741211}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "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": "2020-10-29 10:29:38"}
{"_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": "6jWf4d7b3iuWvPpJJ", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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, 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": "3K8Yy4JYRbeazdyba", "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-10-29 10:22:33"}
{"_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": "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": "NBRpNG6ntviDcDNr4", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\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 | 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 | 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,t2:Teacher | all 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 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\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": "dT4ochS5YPqwvsQjX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:18:42"}
{"_id": "LxuRoNCzKzH8LZj88", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some t:Teacher,g:Group,p:Person | c->p->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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7GtEHrSuJ8y5k2FkS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 15:14:02"}
{"_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": "sfNKm8YXwSFq6iGKi", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 p1, p2 : Person | some g : Group, c : Class | \n  \t\t(c -> p1 -> g in Groups and p2 -> c in Teaches) and (p2 -> p1 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": "4fAWYf25RLbgCKzdW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:49:53"}
{"_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": "pLJG34zMf8TjihNiY", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, g : Group, p : Person, 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\tall t: Teacher | some c: Class, g: Group, p : Person | c->p->g in Groups and t -> c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "t246KSkzu7zgv84ZJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:09:40"}
{"_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": "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": "2FfQEkY8AZFWovSuS", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all 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": "QLPB7Ye2kk5wuSM5S", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:12:25"}
{"_id": "ZP6yFzKS5KrvG9G8N", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (some t : Teacher | t->c in Teaches )\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\tall t : Teacher | some c : Class, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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\tall p1 : Person | (p1 in Teacher) or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher) or\n\t\t\tsome p3 : Person | (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher)\n\t\t)\n  \t\t\t\n}", "derivationOf": "WsG57njkWfWHR3H7f", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:29:39"}
{"_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": "5EQdx6DbCgj32FHx5", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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, g : Group , t : Person | c->s->g in Groups and t in Teacher and s in Student 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": "o6J3BxvMwuaFRvvAL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:34:02"}
{"_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": "QoaWSsfPoTMKPgt6d", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | some g: Group | some p: Person |  t->c in Teaches implies c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZWFj5uaFzTx859GRh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:27:45"}
{"_id": "Gd596nAmCwHo5BrYZ", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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": "XRdrYsf3ngygjgoa7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 12:14:47"}
{"_id": "K8mLdAtbtZcuuR2Ph", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 c:Class | some:Teacher t->c in Teaches) implies s->t 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": "SMuL6QEd4BYDQF4im", "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": "2020-10-29 10:04:02"}
{"_id": "BTPEoAs7avjqWtgNW", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(all c : Class, s:Student, 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\t(all t : Teacher, 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "dW2KkRzRkgZiEBrsp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:12:38"}
{"_id": "PdRRj8xyD4vKpuwNP", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  some t: Teacher | some c: Class | c.Groups in Teacher and lone t.Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Gz5t9LPkP4rQPQyZN", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:49:31"}
{"_id": "6gE6ZajNEiQu863Fm", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, 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\tall t: Teacher | some c: Class, g: Group, 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\tall p,pp: Person | p->pp in Tutors implies p in Teacher and pp in 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 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": "4dMf2bw7eqhoD58K3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:21:53"}
{"_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": "esMDzGHm28PKQ5Ff5", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n/* 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.Tutors\n}", "derivationOf": "C9WDjyY3mPfufyY3t", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-30 22:37:25"}
{"_id": "fghx3zKZiBBui66t4", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n  all x : Class | (all t : Teacher | t->x in Teaches) implies (all p : Person, g : Group | x -> p -> g in Groups)\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "2vLMTEbEhvra9ad9z", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:11:27"}
{"_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": "S9dhnRh3XB25Tgyur", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all t:Teacher | all s:Student | t->s 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": "5bW2CEZpyTLTAquZY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 13:20:56"}
{"_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": "GPeKgzzPtPkh9mz3C", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "zmS3r66ppjLkt26j5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:49:40"}
{"_id": "oHksczmuyBo3GfNwZ", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  some t: Teacher | lone t.Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dZRbPZSXaWiymxdKv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 14:48:00"}
{"_id": "YhFPjzsJnvk9Q5m9p", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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  lone t: Teacher | some g: Group | some c: Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t: Teacher | all s: Student | t->s in Tutors and no s->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": "8fBpcrDiMPnpuAfSo", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:52:24"}
{"_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": "tcx7tTQWoTiZqeAmZ", "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\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "ZQF2fvQhqzD64qj6M", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:25:44"}
{"_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": "KLLtWceg8SCwi4Ho6", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\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 | 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 | 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,t2:Teacher | all 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 | 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\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": "XHBGinx96yFLZhADk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:50:41"}
{"_id": "TMwoGgzfQ9tcFokeG", "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 p : Person, c : Class, g : Group | p in Teacher implies c -> p -> g in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall t : Teacher, c : Class, p : Person | t -> c in Teaches and c -> p -> g in Groups implies 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": "Axz6TH4PQrCu9cMvm", "msg": "The name \"g\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 14:14:26"}
{"_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": "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": "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": "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": "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": "eog5aEG6ySHvANW5k", "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/* 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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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  all 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  all p1, p2 : Person{\n    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  all s : Student, c : Class, g : Group | all t : Teacher | (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": "xZsgr9bijPaahGJyX", "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-10-29 09:51:44"}
{"_id": "n6WdbL6Z6Dg35eYya", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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": "6ig5dwepe2C5xasmF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:51:11"}
{"_id": "R8jBZwn4JvfsFjwqs", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n  all ps : Person | some c : Class, some g : Group | some t : teacher | c->ps->g in Groups and t->c in Teaches implies t->ps 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": "uMNKEr7G4TTBFSyHP", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 11:27:42"}
{"_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": "pb7cPbLFjXPc4bmjS", "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": "2020-10-21 23:49:42"}
{"_id": "MECSZGLW6QSrpAuLd", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some g : Group | t->g in Teaches\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  some 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": "w99sjBH67Py9NZ7YZ", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:28:37"}
{"_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": "uZcB4zW25rcJiZZ3s", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\tall c : Class, p, p1 : Person, g : Group | (p -> c not in Teaches or p not in Teacher) implies c -> p1 -> g not in Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "PSikcbGmhxukKG2y3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 02:47:53"}
{"_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": "BaWJJ6Fb7SXycDyyv", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all p1, p2 : Person | some c : Class | some g : Group | p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->c in Teaches and p2->g in c.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 p1,p2 : Person , c : Class| p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->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": "QkQBfssR4e3XRfmcm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:16:50"}
{"_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": "LKW5xkJaNy5vooEJQ", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group, s:Student, c:Class | t->c in Teaches and s->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\n}", "derivationOf": "8HciBEMe4m7uYPhNE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 14:41:21"}
{"_id": "7GtEHrSuJ8y5k2FkS", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some t:Teacher,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\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZWgoSKyuwSYEbHu2e", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 15:13:51"}
{"_id": "5vtz92toN56fTzQDE", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group | some p : Person | c->p->g in Groups implies (p->c in Teaches and p in Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all s : Student, c : Class, g : Group | some t : Teacher | 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": "o7eucWJGa6AftMky6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:38:03"}
{"_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": "CqqaebSH26xvTeAw3", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 | all c:Class | some t:Teacher | s->t 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": "6vGQ4wGX6y4fv7xZ2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:05:43"}
{"_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": "nvutwWtMRiyrFbkxf", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "7GkbSmbi6oFDb5aJw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:18:20"}
{"_id": "ozgMcTFgXnHGFoYCg", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n/* 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 t : Teacher | some t : Teacher | t in p.Tutors || t in p.Tutors.Tutors \n}", "derivationOf": "rkpHKsgs3NA3CQNpS", "msg": "The name \"p\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-30 22:38:59"}
{"_id": "HC5NHHvdm8jZzzpHm", "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 | 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 | 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,t2:Teacher | all 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 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\t\n  \tall t:Teacher | some c:Class | some s:Student | some g:Group | (c->s->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": "aMJuYHRFiRhxr4hPM", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:24:09"}
{"_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": "mudnt5JbWjJ3sroqW", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  always Person in Student implies Person not in Teacher\n  always Person in Teacher implies Person 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": "qxxY2ZWE6zu26XaXt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 14:51:29"}
{"_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": "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": "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": "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": "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": "axtPFPbkJPJjvyTce", "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\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 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 | all 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": "32QDT49MWFELwQjyG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:26:41"}
{"_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": "m7h5Li6h9m2PYHiJy", "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": "2020-10-27 23:44:17"}
{"_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": "3bMPzSy4Jr44o4aJ7", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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 | (all s : Student | (some g : Group | (s->g)->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": "M6JBhFrz6bj8DKsoi", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person->this/Group->this/Class}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 19:56:40"}
{"_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": "JiGRcNP6bB7tY3Q4G", "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 | 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 | 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,t2:Teacher | all 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": "Au53qBDe3nDWFBPz7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:41:38"}
{"_id": "Yhh8KZPme3WXJ9PPL", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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 \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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by 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}", "derivationOf": "b3pEroRPQd3aeems9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:47:27"}
{"_id": "PD2eNgCX4efYYZqkp", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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": "FqyxSWm4vzyJnvsWb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 21:38:53"}
{"_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": "eRX66NGLCEaeKqE65", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, g: Group, p: Person, 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\tall t: Teacher | some c: Class, g: Group, 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\tall p,pp: Person | p->pp in Tutors implies p in Teacher and pp in 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 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": "CJDCdouN7WCYb5Xiw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:17:26"}
{"_id": "fZoMZbKSbewDMsCQ5", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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 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\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/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "f58fpevfEoc8geDRG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:36:33"}
{"_id": "TkWxj5wtHYM3CxHKq", "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\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": "B6uu7hKEeKg93ynkj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:01:52"}
{"_id": "FWRtWn6MfbiPW6smM", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bGbvsxWJmrYD3kAcB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:40:07"}
{"_id": "yhejxrJ6Px5RtxEoB", "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 f : Person | f in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall f : Person | f not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall f : Person | f 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\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teaches->c & Teaches) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gyQZwzHXjfE4ACjNZ", "msg": "& 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": "2020-10-29 10:25:29"}
{"_id": "Xj3Twq3Ca9SdBnXZk", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tsome x : Teacher | all c : Class | x->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": "jtfZuw3yvJYqSx2pj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:17:44"}
{"_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": "vXGjXWkkLW6TA95hm", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n/* 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 || t in p.Tutors.Tutors || t in p.Tutors.Tutors.Tutors\n}", "derivationOf": "6iGrXELqmPLJF3Sa5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-30 22:38:13"}
{"_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": "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": "K4ytm93fR9zgegjBT", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\t\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  \tall p1 : Teacher , p2 : Student | 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  \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": "mj2Xbbkk8AQKCmYYL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 03:46:24"}
{"_id": "gyvwbQmFBbCcbeekG", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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, g : Group | some t : Teacher, c : Class | \n  \t\t(c -> s -> g in Groups and t -> c in Teaches) and 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": "rD5XxghwfPYFKxQdn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:45:39"}
{"_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": "sFJSd4TQWdR6A2SE2", "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 all p : Person | p in Student\n  \n}\n\n/* There are no teachers. */\npred inv2 {\n\n  no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9o7J8g2jreCLk4yyr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 17:31:05"}
{"_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": "c2aJDxie5qubwqkzj", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Person | some c : Class, s : Person, g : Group | c->s->g in Groups implies t->c in Teaches and t in Teacher\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": "Dt9f7kgx2HaKJpuEC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:01:56"}
{"_id": "b2zkSFbkz6XHasYvW", "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\t\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: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\tall t1,t2:Teacher | all 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": "Ht8XTEn2qfHGTmtBa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:13:19"}
{"_id": "4c7eramC6eDc7GLWG", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MJg9Ge8fXhRkaxT2d", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:36:19"}
{"_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": "wEiNSGsRYbyRwK3xX", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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  lone t: Teacher | some g: Group | some c: Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t: Teacher | all s: Student | t.Tutors and not s.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": "83RWHQkLc3bdocWg4", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:50:26"}
{"_id": "T2C4MqwNmB75NfsqR", "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 => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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": "jvsxddS88xccdmcN9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-30 19:18:37"}
{"_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": "BgzodBeDWSi5bEDBB", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (some t : Teacher | t->c in Teaches )\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \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 p1, p2 : Person\n  \t\t| 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\tall p1 : Person | (p1 in Teacher) or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher) or\n\t\t\tsome p3 : Person | (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher)\n\t\t)\n  \t\t\t\n}", "derivationOf": "2fZT9Hev5jHXxJJJj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:12:18"}
{"_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": "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": "nRQgwSmEuHoaFyY3n", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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\t(some c:Class | some t:Teacher | t->c in Teaches) and implies all s:Student | 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 p1,p2,p3:Person | \n}", "derivationOf": "udSXA9NxaeHbcLrdX", "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": "2020-10-29 10:18:56"}
{"_id": "mhKzcdhWpXu44yA3G", "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\tnot (all p : Person | 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": "pdNndiKh8gcMbt9mp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 19:42:32"}
{"_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": "5eJjQaHoLKknqdzXs", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | one t:Teacher | t->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": "Smc3n8o2W37vxZj5A", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2021-1-12 01:00:39"}
{"_id": "ghKMJvPd9p4zwb28W", "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\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\tall p : Person | no (p.Tutors + p.Teaches) \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Db7GFknqQNidEdmNf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 20:09:20"}
{"_id": "wrcyFK7EqvqQKg5ay", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some c.Groups) implies (some (Teacher & c.~Teaches))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some (t.Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n  all p : Person {\n  \t(some (p.(~Tutors) & Teacher)) or\n  \t(some (p.(~Tutors).(~Tutors) & Teacher)) or\n\t(some (p.(~Tutors).(~Tutors).(~Tutors) & Teacher))\n  }\n}", "derivationOf": "FqHepagDDcRFQ6W8k", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:11:30"}
{"_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": "5HsPmC3Cs4Tv8F7RJ", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tall c : Class, p : Person | p -> c in Teaches implies 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": "gtPtmedCXgWioohBh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 21:00:08"}
{"_id": "mpNKPGqispNGdx6Zr", "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\t(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\t(all 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\t(all 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  (all s:Student | some g:Group, c:Class, t:Teacher | 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": "4u7wLZZvQXP79u8nC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:01:11"}
{"_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": "38ggQzT24P77uP6pN", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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": "cXJuaF7wEqN59e5j5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:48:50"}
{"_id": "fMuSsJxsDtpijezXd", "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, 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->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": "pyg9L3MkPTaY3Wf5q", "msg": "The name \"x\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:12:14"}
{"_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": "yA4E8HDbS39HnXzKJ", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t: Teacher| some x:Class | t->x in Teaches implies some g:Group | x->g in Groups \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\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": "TBK4ShpD8Pj5GZZKa", "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": "2020-10-29 11:43:04"}
{"_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": "qWx87EJweyzBaiDd2", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \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  all p1,p2 : Person | (p1->p2 in Tutors) implies p2 in Teacher and p1 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": "dTQtxvhD2djaD5Doy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:29:33"}
{"_id": "MNZAa5kD9rSnDCMMJ", "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  \n  all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n  \n  no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n  \tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \n  all p : Person | p 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": "d9ZeMfLnMaxiGgatv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:35:05"}
{"_id": "PsYKthHhC7cmaj8Lo", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Xrar9HZu6S5Bn6sf5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:07:45"}
{"_id": "chDdLyZfzFLqC6s5K", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (some t : Teacher | t->c in Teaches )\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \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 p1, p2 : Person\n  \t\t| 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\tall p1 : Person | p1 in Teacher or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher) or\n\t\t\tsome p3 : Person | (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher)\n  \t\t\t\n}", "derivationOf": "mf8NCDLzQW8hpqufX", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:10:04"}
{"_id": "zRDGkvFpBvqe6HbKA", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall t:Teacher ,some c:Class | t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\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": "e7JrNuKaCf8Jc5FQy", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 11:51:43"}
{"_id": "km86yE62neSLKroAC", "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\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall 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 Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s,t:Person | all c:Class | 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\tall s:Person | all c:Class | all g:Group | (c->(s->g) in Groups implies (all t:Teacher | t->c in Teaches implies t->s in Tutors\n}", "derivationOf": "jDoEFD4id9keRuqcc", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:43:47"}
{"_id": "2f6yTKTJMaZCeM8Ng", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, g : Group | some c : Class, t : Teacher | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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\tall p1, p2, p3 : Person | (p1 -> p2 in Tutors implies p2 in Teacher) or (p1 -> p2 in Tutors and p2 -> p3 in Tutors implies p3 in Teacher)\n  \t\tor (p1 in Teacher)\n}", "derivationOf": "EDCBFQbADk2AFxREm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:55:39"}
{"_id": "BqRXNnDjRvxMKicHk", "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\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": "inmKpDxy6JEgs3yth", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:01:47"}
{"_id": "PXNYNyEGCLfv5CiF9", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "m5dtfkmKjihsMv3S6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:26:36"}
{"_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": "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": "W3ChKqRshZF6qqSim", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student, 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  all t : Teacher | all c : Class, 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": "6cS3Qxe7qZEkY5j2f", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:33:32"}
{"_id": "pGYvdhPHbaTSsSFz5", "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 {\nno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nnot (some p : Person | p in Student and p 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": "9qxYdSXTaAPwJL3eP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 21:42:04"}
{"_id": "6q2geukmFctccAQXf", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 | all c:Class | some t:Teacher | t->c in Teaches and 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": "9MY8WZDmoDiX4RfAT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:23:55"}
{"_id": "nFXYHm4pGRfYHuoat", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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  lone t: Teacher | some g: Group | some c: Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t: Teacher | all s: Student | t->s in Tutors and (not s->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": "YhFPjzsJnvk9Q5m9p", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:52:33"}
{"_id": "WoTgKCkkubz2BfaNK", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 | lone c : Class | t->c in Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4ra9nFHx8nEywjygu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-5 09:00:31"}
{"_id": "ShEaGAbAvt7fwdwyL", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c:Class, t:Teacher | some g:Group | t->c in c.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": "LQTfuxJx5eSMCoftw", "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/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 16:02:54"}
{"_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": "Ey8qnNWbjgPPPEF4W", "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\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\tall p : Person | no (p.Tutors + p.Teaches) and 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": "ghKMJvPd9p4zwb28W", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 20:09:36"}
{"_id": "Af5KyY5ukP5To5JcF", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | some p: Person, g : Groups | x->p->g in Groups implies some t : Teacher | p->g 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": "YjnnQ2745qmGkwzys", "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-10-29 09:21:18"}
{"_id": "5DYPsTq8ByJbbx8Xf", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group | some p : Person | c->p->g in Groups implies (p->c in Teaches and p in Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "oL6WJhmbcTf7aiumz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:34:05"}
{"_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": "FHe97KrMyRujJutSD", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \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  all 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 , t : Teacher | all g : Group | ((c->s->g in Groups)and(c->t->g in Groups)) 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": "X5CaqQ5mZbBpdg6jX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:45:16"}
{"_id": "TCjpGvrW7vNYwtHJ3", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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, g : Group | c->s->g in Groups and (some t : Person | t->c in Teaches and t in Teacher 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": "XxRLmaWScmXQjGbgH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:30:50"}
{"_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": "9o7J8g2jreCLk4yyr", "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 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": "2020-10-28 17:30:06"}
{"_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": "deirjBb3gFhnhaQbK", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  some 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": "L7yAn6eFoyNEY5HdD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 18:47:36"}
{"_id": "a4pdsTLDh3DJfaspM", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, p1, p2 : Person | (p1 in Teacher and p1->c in Teaches) implies (p1->p2 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": "msfamKiQcA56BSTn8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:04:16"}
{"_id": "3SM2KdDtkXJiBd8qA", "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 => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Student.Groups.Group, t : Teacher.c | s in t.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": "W9dt9jH7qra5WbqTW", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Student (type = {this/Person})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-30 23:57:57"}
{"_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": "pnYtm6HknLttigznf", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, g : Group | some c : Class, t : Teacher | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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\tall p : Person | some p1 : Person | p1 -> p2 in Tutors implies p2 in Teacher\n}", "derivationOf": "QdKSw2EZFaXacwmz7", "msg": "The name \"p2\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 00:09:50"}
{"_id": "N7S4Z7LmLEds6t9uR", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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/* There classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | c.t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8hrP6spw7qHEA4wDL", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is t (type = {this/Person})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:12:54"}
{"_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": "buoHa3v2zBkcqHWfh", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PYADqQxjBkwHg7BjY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 15:49:16"}
{"_id": "GcRefLTTJuz7RSDdq", "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\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}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\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-10-27 20:05:32"}
{"_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": "sMsE94cqYsheE3yuw", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 (Person-Student-Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t:Teacher | some t.Teaches\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some( c.~Teaches & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone c.Teahces\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cLRCwBbNc7q6KiHDE", "msg": "The name \"Teahces\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2021-1-13 18:22:53"}
{"_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": "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": "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": "Rayw9sPGAzdgwivyu", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FdkjGiFeJqhYK49Yt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:08:59"}
{"_id": "uMNKEr7G4TTBFSyHP", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n  \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NvqiEbBjyRs9JHGB6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 11:10:06"}
{"_id": "cKT8Czcse3x94sA8e", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 g : Group, c : Class, t : Teacher | \n  \t\t(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": "aq4mtKuXRzExNWfTB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:52:04"}
{"_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": "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": "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": "PYu7YEx4CpfsuGMGe", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "GDy9AWnukEdzpmzGH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 02:07:40"}
{"_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": "DoNwbZT2YaPXMCd4Q", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall x : Person, c : Class | x->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": "g9iguSoPeWxgoup74", "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-10-29 10:12:55"}
{"_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": "32QDT49MWFELwQjyG", "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\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 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 | all 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 | some s:Student, g:Group | 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": "aK9EZX7RWySfoKJoC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:26:16"}
{"_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": "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": "Z5Wa96iaH44CJov8C", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x 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": "va9kDpGhG9Zn38z2g", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:41:09"}
{"_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": "WNa9W24avPQhrnfQL", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some c.Groups) implies (some (Teacher & c.~Teaches))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some (t.Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fz6LeSceqb6hgwDTF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:08:00"}
{"_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": "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": "nz9Ri6jziQPxiyWFz", "cmd_i": 13, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tsome s :Student | some c:Class | some g:Group | c->s->g in Groups and some t:Teacher| t->c implies t->s in Tutors\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "oTNJrRQ3T4B994vec", "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-10-29 09:56:11"}
{"_id": "9W4ZWqP4nwd9EQqDP", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Students,t:Teachers | t->c in Teaches implies t->s in Tutors\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": "2oqwgMWXGYif8yofE", "msg": "The name \"Students\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:14:38"}
{"_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": "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": "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": "etRYcms5pmqieqFBL", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | t in Teaches\n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x 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 \tall 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": "SahYMxH6F8wti3HmZ", "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-10-29 09:35:14"}
{"_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": "7obuMxLSjmTPe3DqJ", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 | all t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "do4KzfsG5CmXdx6Za", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:38:11"}
{"_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": "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": "HB534F9Sx245RjzJD", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, g : Group | some c : Class, t : Teacher | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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\tall p1, p2, p2 : Person | (p1 -> p2 in Tutors implies p2 in Tutors) or (p1 -> p2 and p2 -> p3 implies p3 in Tutors)\n}", "derivationOf": "p4CvdfT3Hgkv23mmf", "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-10-27 23:54:23"}
{"_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": "6kb9yv4xPtbeds5Bq", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | c->t 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": "j59xoQ4nsnqrFetRB", "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": "2020-10-29 09:46:27"}
{"_id": "z9Ec4jNiS5cwnQEdQ", "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\t(all p : Person | p in Student implies p not in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t(all p : Person | p in Student or p in Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t(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": "JYdGHp2NLrTDAM7fR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 22:45:46"}
{"_id": "8Y6sJnt7sjRBR3WwA", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nnot (some p : Person | p in Student and p 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 Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall 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 {\nall 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 {\nall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class, 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 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\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "o8Jpwh3nehR6ja7Hd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 21:57:48"}
{"_id": "qWk8HxgaBEWtPpvmb", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, t : Teach, 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\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/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NcgCi6vaBCPFReNc7", "msg": "The name \"Teach\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 23:42:30"}
{"_id": "BfxunyqjbK9GwPtxC", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some 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": "W58nCGYTxwcdRLy38", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2021-1-12 00:59:19"}
{"_id": "ogiQpmqEum6qG2wFt", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Teacher | p.Tutors in Student and p.Teaches in Class.Groups[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": "dnqJd2j874HmugM9u", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 15:16:55"}
{"_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": "6iGrXELqmPLJF3Sa5", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n/* 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.Tutors.Tutors\n}", "derivationOf": "esMDzGHm28PKQ5Ff5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-30 22:37:30"}
{"_id": "PYADqQxjBkwHg7BjY", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "y5hvQthPTaxETAdMC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 15:43:40"}
{"_id": "MYczbJAJe3FbofhB6", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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": "4DKgxfXAh37CNoXuN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 21:00:01"}
{"_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": "Ssx2QTszfbh6yrmNG", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t(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\t(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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\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}", "derivationOf": "zegf4a33j6wxACAKi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:15:02"}
{"_id": "GFCxoajXwAFi9ABnP", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g 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": "fLh7fhwcXwYo3uWhk", "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-10-29 10:19:13"}
{"_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": "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": "u5yYfQL2sYFGotcvg", "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 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n\n  \n  all p1,p2,p3:Person | (p1 in Teacher implies (p1->p2 in Tutors) implies (p2 ->p3 in Tutors) ) and p1 not in Student\n    \t\t\t\t\t\n}", "derivationOf": "XHpWhFt4a7N7ZPaeg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 15:09:39"}
{"_id": "C3jCExpoLotvTLFLx", "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-9-30 10:03:18"}
{"_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": "6DPJMWtMqw65Km3aX", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall p1,p2:Person, c:Class | p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->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": "KawmQAjZp9BT4594M", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:20:02"}
{"_id": "duScvaTqGroNqZXbg", "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 p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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 t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | 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": "8RqQ2huXxHq3q5QAa", "msg": "The name \"s\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:17:45"}
{"_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": "JrY8rfzeATiAaisGb", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "k5Fi6f6rRZdTpjFTH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:18:24"}
{"_id": "wTwFhJ54m3RPXHrSS", "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  all p : Person | p in Student\n  \n}\n\n/* There are no teachers. */\npred inv2 {\n  \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  all p : Person | p in Teacher implies p not in Student or 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  all p : Person | p in Student or p in Teacher\n\n  \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  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  all t : Teacher | lone c : Class | t -> c in 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": "zpEgaYPFut2KPMgCK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-5 01:18:26"}
{"_id": "DRFsS73sQ7EpetR9R", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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  \t\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": "PyEjiwDoKBZbQZC8o", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 01:39:25"}
{"_id": "QXzHpwdmsb3YciSS9", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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 p1, p2, p3 : Person \n  \t\t| \n  \t\t  ( (p2->p1 in Tutors and p2 in Teacher) and\n            (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher))\n \n}", "derivationOf": "XBEQABE6EYPdWiY4S", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:00:43"}
{"_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": "iJ8jMJhvtu2watmLv", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s,t:Person | all c:Class | 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\t\n}", "derivationOf": "634pDqZmjdvSQvEFG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:47:58"}
{"_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": "ynZ5S8YzFdsaNg4cS", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 p: Person | some c: Class | some 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\tall p: Person | all s: Person | p->s in Tutors implies p 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 | some g: Group | all c: Class | 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": "TSNFhTQL52pwhvqR2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:13:50"}
{"_id": "KJPbfkho6MHmgg3Jj", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall c:Class | some g:Group | some t:Teacher | 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": "iJGot4cpStSH9XQ5X", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:56:31"}
{"_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": "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": "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": "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": "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": "ZAbrryvTkwoa8GW58", "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 all 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 Teacher and p not in Student)or(p not in Teacher and p in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nD6JbfmabEYaNQvfE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 23:46:59"}
{"_id": "49mCDntEzHpTHk3kH", "cmd_i": 10, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class |some g:Group |some p:Person | c->p->g  implies some t:Teacher| t->c in Teaches \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  all 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\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 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "kJMk69YDsyBrWYj34", "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-10-29 09:15:52"}
{"_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": "p9hTvH4kKuZYoEYmB", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s,t:Person | all c:Class | 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\t\n}", "derivationOf": "3Yy9WziiJpakCpug5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:48:10"}
{"_id": "TBK4ShpD8Pj5GZZKa", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t: Teacher| some x:Class | t->x in Teaches implies some g:Group | x->g in Groups \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\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": "QeLANNvoWaRa3JF5Q", "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": "2020-10-29 10:50:13"}
{"_id": "NDJBdmGCukWTnEvLb", "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  all p : Person | p in Student\n  \n}\n\n/* There are no teachers. */\npred inv2 {\n  \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  all p : Person | p in Teacher implies p not in Student or 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  all p : Person | p in Student or p in Teacher\n\n  \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jYv52ndMdsJm7LiDs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-5 00:56:20"}
{"_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": "uHtDBZ4o2SXpc4Z62", "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 => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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, c1 : Class | t->c in Teaches and t->c1 in Teaches implies c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Y2SixXF9Wmnvo3AdZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-30 20:37:02"}
{"_id": "ATD9iFMZu2dmdMeYR", "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\tall 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": "CXRXYq7azcDSpzrQF", "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": "2020-11-5 00:38:13"}
{"_id": "j4v8j2LninvZxDCou", "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 Teacher implies p not in Student) and (p in Student implies p not in 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\tsome c : Class, some 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": "tEKZzNboR4H7ifeHH", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 13:33:02"}
{"_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": "SqotzmqWsXc6XE7dv", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "ExGNp26J2kZofu46w", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:17:15"}
{"_id": "5aFmL7cyeAH8LLCR2", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | all 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": "9BddqksdAZEWyqhmK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:44:01"}
{"_id": "Jo5tx3tkTmGPXzPca", "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\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t(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\t(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\t(all t : Teacher | some c : Class | t->c in Class 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\t(some 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\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": "W8M6dLjr3xgtTKCJr", "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": "2020-10-29 09:31:00"}
{"_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": "pZLjwqwDPNToyF4xr", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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": "QXzHpwdmsb3YciSS9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:33:33"}
{"_id": "54wZHCjxWuFgfmbKY", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 g : Group, t : Teacher |  c -> s -> g in Groups  implies (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": "uv8C2mLmvu9ZrxBbs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:14:52"}
{"_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": "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": "QaMk5e27vb86QBT64", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "saCpRCb3C3vmdMTgx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:15:28"}
{"_id": "j4ze45RTh2vhT7Epm", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x not in Teacher\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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all 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": "gZ5kiR8hf6eBjKKpj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:01:03"}
{"_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": "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": "rZSL8X2zrQ2nMMK3T", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SmEduQN2wdPaJiDHn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:45:37"}
{"_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": "qdGwcb4aDg83RWX87", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x 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 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": "W54Fq2vtNK4Z3GqAy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:30:57"}
{"_id": "tZJsoNEGvfLG7Fu5w", "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 Teacher and p not in Student or p not 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": "irnr5PbrKAQAg7taN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:15:15"}
{"_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": "Q2NZCfq3H5kHrRsgF", "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 = Student\n}\n\n/* 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 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\tall x : Person | x in Student or x in  Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x : 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": "TTF25Ns76HxdvEmQr", "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": "2020-10-29 10:07:18"}
{"_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": "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": "C4EBeDjrn2y4vesQy", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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\tall p1, p2 : Person\n  \t\t| 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\tall p1,p2,p3 : Person\n  \t\t| p1 in Teacher or\n  \t\t  (p2->p1 in Tutors and p2 in Teacher) or \n  \t\t  (p3->p2 in Tutors and p2->p1 Tutors and p3 in Teacher)\n}", "derivationOf": "ZbP3srCFx9jYq5SAx", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 22:02:29"}
{"_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": "TGEXFxSfJMZDbR6ZN", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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 \t\n  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by 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}", "derivationOf": "SLhmhazH7GJBhxfeb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:06:23"}
{"_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": "dGmE2q3ctAbWTZrGJ", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | all t, p : Person | c->p->g in Groups implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mdjaMW5feszXD7qa5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:12:49"}
{"_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": "xqhwiAvAB7oiDAtBc", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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/* 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\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PerRraCTvhKc87b5s", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:02:07"}
{"_id": "jTJNosSGFeSBc7QeL", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (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": "uQTqpj3ksWna2MLCH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:21:15"}
{"_id": "9DDcjecQHahnQCtdi", "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\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QKDhkAWFRj8fDj7he", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-9-30 10:01:54"}
{"_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": "XM7EPsr34CAZ2rgFw", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\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\tall p:Person | p in Teaches implies p 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": "r8jNcTtHYXThq4j3x", "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-10-29 09:34:35"}
{"_id": "SFLz3T5S3i4gvxhzq", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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\tall t: Teacher | some g: Groups | \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fQ4H44JtD7ahmKHPL", "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": "2020-10-29 12:45:18"}
{"_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": "JQx9DbXjuLvA7Kf9h", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(all c:Class | (some s:Student, g:Group | c->s->g in Groups) implies (some t:Person | t->c in Teaches))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "qho8myujvfdcCrGqy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:37:14"}
{"_id": "urTH8oDMDXWywoEyC", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tsome s :Student | some c:Class | some g:Group | c->s->g in Groups \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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "qWm9PnrjX8tgFEhar", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:54:55"}
{"_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": "qtp4Kg9FoYRq8MT7S", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some c.Groups) implies (some (Teacher & c.~Teaches))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some (t.Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n  all p : Person {\n  \t(some (p.(~Tutors) & Teacher)) or\n  \t(some (p.(~Tutors).(~Tutors) & Teacher)) or\n\t(some (p.(~Tutors).(~Tutors).(~Tutors) & Teacher))\n  }\n}", "derivationOf": "sg8KQRoXzYYCwxYeD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:11:52"}
{"_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": "QycGLcbuQbCCKfhnc", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student, 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/* 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": "Pasyuc8kexXxSmp2L", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:44:44"}
{"_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": "8yPDmaqwwicpPCTAZ", "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": "2020-10-22 10:22:21"}
{"_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": "YCLCZzzvHFw99PyxN", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  \tall p :Person| some g:Group |  p in Student and p->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XfZCn5PZjHspEftdB", "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": "2020-10-27 12:22:27"}
{"_id": "MmSEB5nkzoR89scae", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all t : Teacher, s : Person | t->s in s.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": "tEkcBaHr8d6S3P7fi", "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": "2020-10-28 18:59:04"}
{"_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": "FphZizFMYinnZwtYF", "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/* 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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some c.Groups) implies (some (Teacher & c.~Teaches))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some g : Groups | some (t <: g)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "s4u5DDpgwk2SZ5ndB", "msg": "Analysis cannot be performed since it requires higher-order quantification that could not be skolemized.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2021-1-13 17:06:14"}
{"_id": "BX52dd4ohMBRnop96", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p in Teacher implies p not 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": "uXy6TCLuDgsEKqMZH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:19:29"}
{"_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": "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": "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": "5qag4LAGL9ZPptvts", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all p1, p2 : Person | some c \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 p1,p2 : Person , c : Class| p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->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": "uH2H6D6Ag2jP25dMj", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 19:13:52"}
{"_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": "yPzBdS4titjb5KxAA", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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 | (some g : Group | c->s->g in Groups) implies (all t : Teacher | t->c in Teaches and 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": "Nejoh6aEGdvMuoYNG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:35:36"}
{"_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": "oGz7dj74fedMu96Br", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | all t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\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\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 Class->t->Group\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "A37ip2KdW7xpdcKYD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2021-1-12 01:05:49"}
{"_id": "r24kbHneKGqZCBEun", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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 \tall t:Teacher | some g:Group,c:Class | c->t->g in Groups implies t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by 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}", "derivationOf": "5gTQXH3frxw49jgmE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:50:04"}
{"_id": "r49pyA5dPgYQDxSst", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s,t:Person | all c:Class | 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\t\n}", "derivationOf": "tCNHpM6pgmhpj26Z9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:36:43"}
{"_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": "3fEqaErL4GJAH3uWw", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rat48DpoYYPzYSrHS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:49:23"}
{"_id": "38Li9ARcTBnCdR3kM", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \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  all 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 c : Class , s : Student , t : Teacher | some g : Group | \n    ((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": "WwT9Q9wzmn4xCGZwi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:49:43"}
{"_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": "oeGrySWQwGep3W365", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all 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\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Awk3CjPdAY3pK3jwZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:26:54"}
{"_id": "RPEhdQw7QgnpYqSJC", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (some t : Teacher | t->c in Teaches )\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \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 p1, p2 : Person\n  \t\t| 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\tall p1 : Person | (p1 in Teacher) or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher) or\n\t\t\tsome p3 : Person | (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher)\n\t\t)\n  \t\t\t\n}", "derivationOf": "moJ8fPGHGeooi7pkw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:10:45"}
{"_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": "EM3K3aZtCr4QqkGKB", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t: Teacher| (some x:Class | t->x in Teaches) implies some g:Group | x->g in Groups \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\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": "TXZRzGwtfN5wvuABt", "msg": "The name \"x\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:29:29"}
{"_id": "r6MnyutYzYeaDuzC9", "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, 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 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\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->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": "mTuPwaZTBs8giLf8h", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:27:12"}
{"_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": "pRqAoeA73f9KwwSeg", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 | t->c in Group.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": "bk6ARBuaXGHYWLxrm", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class}\nRight type = {none}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:35:14"}
{"_id": "2khd5NDN8jZqbLNeh", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s,t : Person | all c : Class | 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\t\n}", "derivationOf": "DRf6v4Ne3b8QPBATd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:35:33"}
{"_id": "8ACPJvoZ4n2rkru3W", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n  all ps,t : Person | some c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yFo8FPCgm3tCrkQb2", "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": "2020-10-29 11:38:13"}
{"_id": "MbZXCGFRkXyKeetRk", "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/* 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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | t->s 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": "QxdCXmc7akCDvve5n", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:37:19"}
{"_id": "NZkLsLZi7nXJRtHPv", "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, 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 x : Class, s : Student | some g : Group | x->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": "QwSbkCsbfPZNY7eh4", "msg": "The name \"p\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:10:48"}
{"_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": "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": "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": "viXduxC7rXDCtisTc", "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 | 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 | not (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": "SiDzpt6pZuaLPjTtJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:16:20"}
{"_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": "GgYYvn8qidfCYnhBE", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  some t: Teacher | one t.Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3k3Bw3nxcdr3wZuZj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 14:46:01"}
{"_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": "rs8gGQniphT95S7jX", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall p:Person | some c:Class | c->p in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Person | all 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\n}", "derivationOf": "XM7EPsr34CAZ2rgFw", "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": "2020-10-29 09:42:58"}
{"_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": "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": "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": "5fYG6jxpWdrx9BqhR", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 | some t.Teaches and c.Groups.t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "k5rYkR3CzsHPdhTpC", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:28:27"}
{"_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": "Yx7Z6pwx3acwC2kDM", "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\t(all 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\t(some t,s : Person | s->t 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\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": "tNKPme63gogbbCNpf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:41:51"}
{"_id": "yDstzzwHHiApgDW5o", "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\tStudent or 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": "DaYoKHj9sFwPLLaDE", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-22 10:23:15"}
{"_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": "oGrwDFjWDRJxRE95W", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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\tall p1 : Person | (p1 in Teacher) or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher) or\n\t\t\tsome p3 : Person | (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher)\n\t\t)\n  \t\t\t\n}", "derivationOf": "EM7dvFBhZMbSWfd2q", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:35:54"}
{"_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": "wrRDWCW8ufhPHavQz", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | all t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mwdEHtrGsRr8dhxCE", "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": "2020-10-27 14:36:47"}
{"_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": "u7S9ujTPor2E53b3N", "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  \n  all s : Person | s 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  no (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": "wqBNWHamTojLuCcMq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 19:41:13"}
{"_id": "opXGm73frHydJ7789", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\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 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": "pHRodQLXwhc5MSzzp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 22:59:13"}
{"_id": "sAAvN63QMFjhzoYQH", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t: Teacher| some x:Class | t->x in Teaches implies some g:Group | x->g in Groups \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\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": "yA4E8HDbS39HnXzKJ", "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": "2020-10-29 11:43:15"}
{"_id": "4uy6JMXkKbSJox48s", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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": "FdDxFxxWEqmWT8ka7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:49:21"}
{"_id": "QkQBfssR4e3XRfmcm", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all p1, p2 : Person | some c : Class | some g : Group | p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->c in Teaches and p2->g in c.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 p1,p2 : Person , c : Class| p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->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": "QsFKehuk9F9n5aFDP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:16:48"}
{"_id": "feBccusmYrdZEwftj", "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\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\nall c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* 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-11-18 18:21:31"}
{"_id": "Sar4Cgfw824qTES79", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t: Teacher| some x:Class | t->x in Teaches implies some g:Group | x->g in Groups \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\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": "sAAvN63QMFjhzoYQH", "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": "2020-10-29 11:43:24"}
{"_id": "LBFbHTFtyLoCKDre3", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s,t:Person | all c:Class | 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\t\n}", "derivationOf": "iJ8jMJhvtu2watmLv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:48:01"}
{"_id": "ZLzrHQYsAWat9Yne3", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "a94JuPDKH8yBijduc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:03:42"}
{"_id": "mPts4SgH76xr3TBDG", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\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 | 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 | 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,t2:Teacher | all 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  \tall c:Class, s:Student,  t:Teacher | 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\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/* 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) implies ( (t->c in Teaches) 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": "2e7SWPEE3PyJZWXBx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-4 22:16:30"}
{"_id": "u73QSAfmuZDsurpMJ", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\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 \n      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": "yDC8WCFT5g9FesrTG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 22:50:21"}
{"_id": "rp9gWyhTSjm7MJbCv", "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": "C3jCExpoLotvTLFLx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-9-30 10:03:28"}
{"_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": "Aaq3hHPxDMSWSSBqL", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 (Person-Student-Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t:Teacher | some t.Teaches\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some( c.~Teaches & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t:Teacher | lone Teaches.t\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DskWbwEopy6QKCjA8", "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": "2021-1-13 18:20:51"}
{"_id": "yFP983QtNSHPNcsAM", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student | some g:Group,c:Class | c->s->g in Groups implies (all t:Teacher | 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": "GWxF99Yb4We8mr3CE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:28:27"}
{"_id": "2NELgLBSnKJCesnTo", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (some t : Teacher | t->c in Teaches )\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\tall t : Teacher\n  \t\t| (some c : Class, s : Student, g : Groups\n  \t\t\t| c->s->g in Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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\tall p1 : Person | (p1 in Teacher) or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher) or\n\t\t\tsome p3 : Person | (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher)\n\t\t)\n  \t\t\t\n}", "derivationOf": "23RZ8qAG2trzh3wtS", "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-10-29 09:28:12"}
{"_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": "zLXpSqbZHGX38qXzP", "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/* 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 { \n    all p : Person | p in Teacher or p in Student\n}\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zXTyQsuYZRybRbXRN", "msg": "There are 5 possible tokens that can appear here:\nenum fun let open pred", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 18:38:40"}
{"_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": "NpcPwPBtLMMcePM4z", "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\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "J5j8hJsXnu7KkHYt6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:22:38"}
{"_id": "2PsJW7GpZZwGfSkoM", "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  all p : Person | p in Student\n  \n}\n\n/* There are no teachers. */\npred inv2 {\n  \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  all p : Person | p in Teacher implies p not in Student or 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  all p : Person | p in Student or p in Teacher\n\n  \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  all Teaches.Class\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2LkbCuYepg7v4vnjB", "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": "2020-11-5 01:00:08"}
{"_id": "hYZ77oo6ApgfXWgj3", "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 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": "2020-10-29 09:23:13"}
{"_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": "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": "QFcsDxr6AefLRAZHk", "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, 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 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\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": "b3B6khMQ7utAPBRML", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:21:03"}
{"_id": "YiyZWBjDiFc4cFggQ", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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": "HjJ4L9iKkmmdAkNBB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-12 00:53:46"}
{"_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": "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": "S6eX3pRHZZ2xeuitW", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "yLfvMJWB52dj4jgTP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:15:16"}
{"_id": "bSxcyXjrTu6hTXxGu", "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\t(some 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": "fth6Dvz5Gw7GmdjWy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:32:13"}
{"_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": "pgQaqHkyDYKKFyJXm", "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 implies x 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": "eSoPbXiL9Pkf5YAo5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:26:15"}
{"_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": "iyo7ufACJeDpWpNiq", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, g : Group | some c : Class, t : Teacher | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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\tall p : Person | some p1 : Person | p -> p1 in Tutors implies p1 in Teacher\n}", "derivationOf": "nfPFZoh7Y77pEeGib", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 00:10:37"}
{"_id": "bew39TczGLWwLNBuA", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | some g: Group | some p: Student |  t->c in Teaches implies c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QoaWSsfPoTMKPgt6d", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:27:58"}
{"_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": "rpCaaQwa5oZdJKkRu", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p 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": "bNEuLRSaTHKeA36ZG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:19:41"}
{"_id": "zydSJSvdPyvNr4NeX", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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\t(all s:Student, g:Group, c:Class | some t:Teacher | 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": "ubz4tuJBNzdcx5iCY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:58:37"}
{"_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": "rLPxcCfgCREEphxg3", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in 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}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "XWf3YCFXpGCGhMhy2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:47:49"}
{"_id": "KHNxQ6HvCAiXYTcBL", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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  some 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\tall p: Person | all s: Person | p->s in Tutors implies p 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": "MqeBes54MY2Jac9SN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:01:30"}
{"_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": "KMy8kngwk6uAtJqZF", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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, g : Group | some t : Teacher, c : Class | \n  \t\t(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": "gyvwbQmFBbCcbeekG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:46:34"}
{"_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": "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": "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": "JysLpxhcLig5FHYpJ", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Students \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "q7cCE98mTu5gxtwHD", "msg": "The name \"Students\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:57:08"}
{"_id": "5XQqBRFXs5wdnDwWZ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(all t:Teacher | some 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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "PQE5JYL26BmmRFCBX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:20:44"}
{"_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": "6vGQ4wGX6y4fv7xZ2", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 | all c:Class | some t:Teacher | t->c in Teaches implies s->t 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": "9h47bWopFMuzxE4jN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:05:17"}
{"_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": "sf5qY9Kb8sCwZX6wi", "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 Teacher implies p not in Student) and (p in Student implies 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, 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": "tnRR98PLjARmrHgSm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 14:09:16"}
{"_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": "vjnhAuZQm6bX6BfMu", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NS86dRCbvkF5tq3Pi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 22:18:28"}
{"_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": "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": "kzdrr6s6A73Wwgy3g", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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": "MYczbJAJe3FbofhB6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 21:01:00"}
{"_id": "ff6AAsjKQfmy7veze", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Person , c : Class, s : Person, g : Group | c->s->g in Groups and t->c in Teaches and t in Teacher and s in Student\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": "q6tffriHgQfEEtMHL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:05:13"}
{"_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": "avaLFxmJNwy4qa8GN", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some g:Group |some 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\t\n  \tall t:Teacher | some c:Class,g:Group,s:Student | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n\tall s:Student,t:Teacher | some g:Group,c:Class | 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": "Nc3DdEGhK2XdqnwvR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:38:32"}
{"_id": "nJTGvKc58MkGJifkd", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\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, 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 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\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 p1, p2 : Person, c : Class | (some g : Group | c->p1->g in Groups) implies p2->c in Teaches implies p2->p1 in Tutors\n\t\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": "GavusxpiQzgpiKKH3", "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": 282.75, "y": 99.5}, "Class1": {"x": 424.125, "y": 99.5}, "Class2": {"x": 141.375, "y": 199}, "Group0": {"x": 282.75, "y": 199}, "Group1": {"x": 282.75, "y": 298.5}, "Group2": {"x": 424.125, "y": 199}, "Person": {"x": 141.375, "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": "2020-10-29 10:48:45"}
{"_id": "wwPkB3iP9KJLEHzc2", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ifTojJpsYdkj6XMta", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 19:04:42"}
{"_id": "guSyLmskwvJh4R6nJ", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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 p1,p2,p3 : Person\n  \t\t| (p1 in Teacher) or\n  \t\t  (p2 in Teacher and p2->p1 in Tutors) or\n  \t\t  (p3 in Teacher and p3->p2 in Tutors and p2->p1 in Tutors)\n}", "derivationOf": "D3ojsY42pL4Q8xkF4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:39:12"}
{"_id": "AkP4Tq4Zj22T4srNu", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n \tall s :Person, c:Class | (some g:Group | c->s->g in Groups) implies  (all t:Person| t->c in Teaches implies t->s in Tutors)\n  \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xYoqCtSsRysTrZGpR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-5 11:22:51"}
{"_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": "fz6LeSceqb6hgwDTF", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some c.Groups) implies (some (Teacher & c.~Teaches))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some (t <: Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FphZizFMYinnZwtYF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2021-1-13 17:06:39"}
{"_id": "oTNJrRQ3T4B994vec", "cmd_i": 13, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tsome s :Student | some c:Class | some g:Group | c->s->g in Groups and some t:Teacher t->c implies t->s in Tutors\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "TtuFvbpdHqCTxJGnt", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:56:00"}
{"_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": "qxxY2ZWE6zu26XaXt", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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": "4prCwwpgPaY3TWXqr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 14:31:48"}
{"_id": "y6TjTW67FLGS5MDn6", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | some p: Person, g : Groups | x->p->g in Groups implies some t : Teacher | t->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": "xywEHeuewyucMqKCc", "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-10-29 09:23:28"}
{"_id": "PzkRf6jRbo75hxGkF", "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 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class |some t:Teacher |some g:Groups|  g in c 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": "WbPLfXRRFauvsfQHR", "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": "2020-10-27 12:43:37"}
{"_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": "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": "tnRR98PLjARmrHgSm", "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 Teacher implies p not in Student) and (p in Student implies 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, 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\t all c : Groups in Class, s : Student| some g : Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "M5p9zSsTpngFJK5Jm", "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": "2020-10-27 14:09:10"}
{"_id": "f64zhrz85ZXqdovrT", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n\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\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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Aox5us2JwGMbuQYi7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:41:48"}
{"_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": "C9u9dtdqPgxevN2bZ", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\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 Teachers and p2 in Students\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sfN6aENoun4mSdSi4", "msg": "The name \"Teachers\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 19:04:17"}
{"_id": "Axz6TH4PQrCu9cMvm", "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 p : Person, c : Class, g : Group | p in Teacher implies c -> p -> g in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall t : Teacher, c : class, p : Person | t -> c in Teaches and c -> p -> g in Groups implies 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": "8MK6QABvrG2p4Lq67", "msg": "The name \"class\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 14:14:21"}
{"_id": "Rozb3j4W8SbToqLRD", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->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": "wcvHRvx8rGoyryjKi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:45:00"}
{"_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": "TSNFhTQL52pwhvqR2", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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\tlone p: Person | some c: Class | some 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\tall p: Person | all s: Person | p->s in Tutors implies p 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 | some g: Group | all c: Class | 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": "iFaKPZM2gipAoN6xK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:13:06"}
{"_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": "L7yAn6eFoyNEY5HdD", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RzR4BivBGLZHt54D9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:45:06"}
{"_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": "JGKdbCwPccuZk6j3p", "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 p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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 t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | 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": "duScvaTqGroNqZXbg", "msg": "The name \"s\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:18:02"}
{"_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": "Hj4ky8T3xLeQcxjKq", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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": "KnFJgf6fojR6QFvLf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 11:58:55"}
{"_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": "oEpAjcM3RgCw9d38Z", "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": "3GNn2PtJ6JxwrDRuv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:41:16"}
{"_id": "SwGizqYPK7P99W5zX", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (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": "6wy9ReqWu6uubHczd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:43:58"}
{"_id": "oL6WJhmbcTf7aiumz", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group | some p : Person | c->p->g in Groups implies p->c 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 p1, p2 : Person{\n    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": "zEtpJqMj5Jxessv9W", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:33:38"}
{"_id": "vCa8uRg72HdW3ydpz", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 c:Class | some Teaches.c\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9BxQcpEJ6kHQMZjrs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2021-1-12 00:55:09"}
{"_id": "KCwzcuYJkYqdRxjrn", "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  \n  all p : Person | p in Student\n  \n}\n\n/* There are no teachers. */\npred inv2 {\n  \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  all p : Person | p in Teacher implies p not in Student or 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  all p : Person | p in Student or p in Teacher\n\n  \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  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": "kQMG3tnGcj42iQ5dw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-5 01:07:37"}
{"_id": "knCxMp9JQE3NW7mKN", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\tall c : Class, t : Teacher, p : Person, g : Group | (t -> c in Teaches and t not in Student) and (c -> p -> g in Groups) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "cMALZE2p4Yz7KNrSN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 02:52:24"}
{"_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": "deZ7noB2kBEzg2Xo8", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all p1, p2 : Person | some c : Class | some g : Group | p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->c in Teaches and p2->g in c.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 p1,p2 : Person , c : Class| p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->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": "Ju6HYRxqmDQ9E7spx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:16:56"}
{"_id": "fe9eBZiiFesNLGy9J", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "W5rHQG9AFgiLM5wBA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 14:08:58"}
{"_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": "TWzJjCWhdYRMo68sw", "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/* 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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all g : Groups | some t : Teacher | all c : Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kWKRqH7mzMuARbiWA", "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-10-28 19:00:27"}
{"_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": "dTdqSs765jzi548B3", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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, g : Group | some t : Teacher |  \n  \t\t(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": "psGyMCorCCgqDdeW5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:56:56"}
{"_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": "psGyMCorCCgqDdeW5", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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, all c : Class, g : Group | some t : Teacher |  \n  \t\t(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": "n3dmD9S43XYksqiBB", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:56:17"}
{"_id": "TnAZxx2D4jmsGJxEM", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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": "vLYfeHboM5DCvytop", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:18:11"}
{"_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": "vhLn5hkFsoQ39taYQ", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | p in Teacher and p.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": "68p3AsoqpoBE8BZqp", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 15:14:04"}
{"_id": "wDL3qcySofNSXeDkm", "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\t(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\t(all 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\t(some 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\t(all s:Student, g:Group, c:Class | some t:Teacher | 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": "YGpwFDi4vhZSryYmG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:47:46"}
{"_id": "y9Rnvn9GBpkAbM7Ye", "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  all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n  \n  no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n  \tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \n  all p : Person | p in (Student + Teacher)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n  some c : Class ,t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n  all t : Teacher | (#t.Teaches)>0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  \n  all t : Teacher | (#t.Teaches)<2\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  \n  all c : Class, | #(Teacher -> c & Teaches)<2   \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2QCmEpRWEzAd9qZBW", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:44:05"}
{"_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": "rbPjL3woMyjqeNt8P", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 p: Person | p in Teacher and some t.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rfDMQ9dqQPxCgeeJk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 14:24:53"}
{"_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": "Pirjqb34sajneLxyx", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, g : Group, p : Person | c -> p -> g in Groups and 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": "RNLrwhW8eLi7iTyJQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 22:25:37"}
{"_id": "2RWXGGYihEoLGNakX", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BfxunyqjbK9GwPtxC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-12 00:59:40"}
{"_id": "gae4LoiTgsyXdZw89", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 (Person-Student-Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t:Teacher | some t.Teaches\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some( c.~Teaches & Teacher) \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone c.Teahces\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tk2i4Fj3zbKZ5iEi3", "msg": "The name \"Teahces\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2021-1-13 18:23:10"}
{"_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": "6chnDWH47JTJwqizM", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\t\n  \t(all c : Class | some p : Person | p -> c in Teaches and p in Teacher) implies ()\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "6aHuDqTg4rcy6dqbK", "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": "2020-10-28 03:12:19"}
{"_id": "o88Cc9Hxioq9bq9GK", "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/* 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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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  all c : Class | all t : Teacher | all g : Groups | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all s : Student, c : Class, g : Group, t : Teacher | (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": "qiqJobh5FWki5nXE3", "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-10-29 09:55:51"}
{"_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": "brhdjtQchz35f5Ave", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\n  \t\t| some g : Group\n  \t\t\t| c->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\n  \t\t| c->p->g in Groups implies\n  \t\t\tsome 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\tall p1, p2 : Person\n  \t\t| 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": "odnn6bdM42tHwZKJk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 20:32: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": "acC73zbJNQcPcnzM9", "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 => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "F3tcKg9ijKhr3PW4j", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-30 18:59:10"}
{"_id": "saBkCB6GXyE3vyfp6", "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  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}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9XXKesFiiT9XbtHaE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 20:05:50"}
{"_id": "4FLLAgyktNQ5sffbe", "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\tStudent 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": "xtLrYmQyH7iTopdo5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-9-30 09:58:46"}
{"_id": "mwivkEPgbseCBA7bm", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9swvqetNF6SaD3SvD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:03:57"}
{"_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": "v7z5hvXww7Sedusav", "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  \n  all s : Person | s 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  no (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": "TRs7Bqg6BNtGCKxQg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 19:44:14"}
{"_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": "n3dmD9S43XYksqiBB", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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, all c : Class, g : Group | some t : Teacher | \n  \t\t(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": "tJX3Hg7csaKoXyvav", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:56:00"}
{"_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": "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": "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": "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": "CbSrTdyCCaJPs7Wjk", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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, g : Group | c->s->g in Groups and (some t : Person | t->c in Teaches and t in Teacher and 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": "TCjpGvrW7vNYwtHJ3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:31:02"}
{"_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": "p9ifcS7HSJWdo8Fo5", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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\t(all s:Student, g:Group, c:Class | some t:Teacher | 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": "pLC7P92b3Ai7JjZuP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:55:25"}
{"_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": "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": "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": "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": "dtYTCkeAdRs6w6hMA", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by 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 Teaches and 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": "xG86qPY3QgBDHA5rq", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:18:37"}
{"_id": "YoD4BS4zqBRDTz8AA", "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 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": "SCAWT2LTuYd4d4JCc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:45:00"}
{"_id": "jM38ZNQb6YgZvgmbC", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student | some t:Teacher, g:Group | s->g in c.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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "99tGfP9cmrTqrezRz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 15:03:18"}
{"_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": "tLym9yKBhrChYaHDe", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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 p1 : Person\n  \t\t| p1 in Teacher \n}", "derivationOf": "fwoncbeSLELYuWxw3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:41:32"}
{"_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": "ft2Q8x9bQa59gFBR4", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n  all ps,t : Person | some c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps 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": "8ACPJvoZ4n2rkru3W", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 11:38:25"}
{"_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": "6PkkN7447qJFZfk7j", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jDtTSEpX3DTWkY5vu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 14:44:06"}
{"_id": "83RWHQkLc3bdocWg4", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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  lone t: Teacher | some g: Group | some c: Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pFKpMrFFEjnoXuew4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:49:09"}
{"_id": "urtgyb9ea6PGmTCsj", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \tall c:Class | some p:Person, g:Group | c->p->g in Groups \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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TGgmQ8WtasrpKKeX2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:12:58"}
{"_id": "FdDxFxxWEqmWT8ka7", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\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": "ca4dKmCoPTTZgKpvQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:47:36"}
{"_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": "vB9L75LSvaqXnRaN6", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | some p: Person, g : Groups | x->p->g in Groups implies some t : Teacher | t->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": "Af5KyY5ukP5To5JcF", "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-10-29 09:21:41"}
{"_id": "XWFdXMQMxdCjFKPS2", "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  Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall t:Teacher | t not in Teaches\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno t:Teacher | t 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": "KLowfPS6SLicGXiAn", "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-6-14 22:51:07"}
{"_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": "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": "7zukxwijbZt7H3pQi", "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\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\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6bJKADJS6tKAvBHCy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-6-14 22:46:16"}
{"_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": "cXJuaF7wEqN59e5j5", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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, 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": "GzYCTPvuuCAuaNC7W", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:48:46"}
{"_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": "RzJ5j9r3hs247Bwkf", "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\t(all c : Class | all s : Student | some g : Groups | 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": "3W9aXBRC9Ly6Xe26S", "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": "2020-10-28 22:58:26"}
{"_id": "z4AH6h2bZ3cKippd3", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x not in Teacher\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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all 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": "mRxGRbJp8mqmz4iKv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:07:40"}
{"_id": "fTvJXbvmAt5dmooKR", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher, some x : Class | t->x 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    all x : Class, s : Student | (some g : Group | x-\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "GHc2RWEK44kpp2pwf", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:44:54"}
{"_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": "dbujb9Qkyhm74JGtT", "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\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tno (Student & Teacher)\n\t\n  \t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t no Student and no 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": "oy8RpzrMwNNdS8Ywy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 19:45:51"}
{"_id": "C6vwPD4cz9qs3yDKL", "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 Teacher implies p not in Student) and (p in Student implies p not in Teacher)\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 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\t all c : Class, s : Student| some g : Group | 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": "Yz22mWvMuKZdrMQJB", "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": "2020-10-27 14:05:40"}
{"_id": "5GwW9hsxnNAfPXdqC", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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, t: Teacher | some c : Class, g : Group |   \n  \t\t(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": "GSPAZHqdFPaTCxBbv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:06:04"}
{"_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": "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": "XLAajWFFNyioKG9jg", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "LTuXJMxtmg9Qfyb2E", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:45:50"}
{"_id": "mpXyWXgfA9S5FwNKB", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\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, 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\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kfuntJStgmQK72dK7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:12:23"}
{"_id": "yKgywPnZzLTTiw96D", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all 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  all t : Teacher | some p : Person, c : Class, 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 p : Person | some t : Teacher, c : Class, g : Group | t->p in Tutors implies t->c in Teaches and c->p->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": "rsWcr6X5mbxyJBNzy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:24:18"}
{"_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": "Kp6uwQqT6PFtadKM4", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s,t:Person | all c:Class | 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\t\n}", "derivationOf": "smYdtiyNNuZqjAke9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:47:42"}
{"_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": "WqFyxKqHnKAQGFWpS", "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 => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some t->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": "acC73zbJNQcPcnzM9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-30 19:06:03"}
{"_id": "fwoncbeSLELYuWxw3", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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 p1 : Person\n  \t\t| p1 in Teacher or\n  \t\t  (some p2 : Person | p2->p1 in Tutors and p2 in Teacher)\n}", "derivationOf": "Ggns2PHp6DyKemsdB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:41:10"}
{"_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": "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": "rD5XxghwfPYFKxQdn", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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, g : Group | some t : Teacher, c : Class | all  g : Group | \n  \t\t(c -> s -> g in Groups and t -> c in Teaches) and 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": "5yfvhDfJan6dWp5sy", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:45:30"}
{"_id": "ZbP3srCFx9jYq5SAx", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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\tall p1, p2 : Person\n  \t\t| 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\tall p1,p2,p3 : Person\n  \t\t| p1 in Teacher or\n  \t\t  (p2->p1 in Tutors and p2 in Teacher) or \n  \t\t  (p3->p2 in Tutors and p2->p1 Tutors and p3 in Teacher)\n}", "derivationOf": "6ucZE6YMCobzNB6Pf", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 22:02:14"}
{"_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": "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": "Z5RczML253G789Qfy", "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": "F6Q2YpNGJds478AZp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 20:46:20"}
{"_id": "pfMcsqNL7zcvutGgc", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group, p : Person | 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  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 p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "s9RhrizFbTxuAmcZ7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:17:03"}
{"_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": "abpCQqs7SSTMABAmH", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There 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": "n9F2ag8nNrdjApfEW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:14:18"}
{"_id": "hAQritWh3uaD8vWBy", "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\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tno (Student & Teacher)\n\t\n  \t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  no Student and no Teacher and no Class\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "W2JEsPGaTb9rGS62o", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 20:10:46"}
{"_id": "P3dxYwCcvJbJQKbLB", "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 all 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 Teacher and p not in Student)or(p not 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": "6zfsTcJQR289P2jAh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 23:45:57"}
{"_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": "fbPPp466hw78L5EXM", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\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 | 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 | 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,t2:Teacher | all 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  \tall c:Class, s:Student, 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\t\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\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": "5sQw2doWLsNpoZatW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-4 21:13:17"}
{"_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": "s4u5DDpgwk2SZ5ndB", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some c.Groups) implies (some (Teacher & c.~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 p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YNhgtEDZJuWBGpfEr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:04:00"}
{"_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": "i8AKLq5G69bvtjkT5", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (some t : Teacher | t->c in Teaches )\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \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 p1, p2 : Person\n  \t\t| 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\tall p1 : Person | p1 in Teacher or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher) or\n\t\t\tsome p3 : Person | (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher))\n  \t\t\t\n}", "derivationOf": "chDdLyZfzFLqC6s5K", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:10:10"}
{"_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": "AxEKqMLvZqhZBp44m", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kLhB5aoZjkRKfotHc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-12 00:58:34"}
{"_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": "ZbzSGuAaQW3ty22Tq", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x not in Teacher\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/* Every class has teachers assigned. */\npred inv7 {\n  \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xnj8tbw9AyAhtbut8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:54:52"}
{"_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": "fdAC6rixGey3i8wo3", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Teacher implies p not 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": "BX52dd4ohMBRnop96", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:19:32"}
{"_id": "Cv5WwzWCKqryhCymN", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | all s :Student|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\n}", "derivationOf": "rFj8e2cqvNcwAdEe5", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 13:15:32"}
{"_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": "Rtwop9S4c2wFNf2Rh", "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 | 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 | 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,t2:Teacher | all 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  \t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n  \tall t:Teacher | some c:Class,g:Group, s:Student |  c->s->g in Groups implies t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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,g:Group | some t:Teacher | (t->s in Tutors) implies ( (t->c in Teaches) 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": "JSTG5cJSGifMd3em9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-5 00:43:48"}
{"_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": "L3DMqYwy9ocAm6Jcz", "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\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t(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\t(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\t(all c : Class, t : Teacher | t->c in Class imples\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\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}", "derivationOf": "wc89vYLgkRD2CLBfu", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:20:15"}
{"_id": "nJhY9o8WZGX8BP3QJ", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->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  all x,y : Person | (x,y) in Tutors implies x in Teacher and y in Studente\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "K478kyPpPib2WDNSL", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:34:14"}
{"_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": "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": "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": "PYxDdPJTCSbWa3ZKg", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person | some g : Group | c -> t -> 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": "xCZ7RARHHYa8w48Nw", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 22:17:15"}
{"_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": "mDWS9pJ6rZ9eZaXyq", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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, g : Group | some t : Teacher | \n  \t\tc -> t -> 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": "WCe6Mg2k9ivNMBbyC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:38:32"}
{"_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": "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": "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": "ijvcep2tdECw8o9sM", "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 Teacher implies p not in Student) and (p in Student implies p not in 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\tsome 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": "uHxTTcfdyecYMWp5c", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 13:34:04"}
{"_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": "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": "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": "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": "NM5poJKTpt49wMaMh", "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 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\nall p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) )\n}", "derivationOf": "SdCwmYcGvhym6bCZJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 14:47:31"}
{"_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": "u6mXtqrXBxAL3PG5n", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  all p : Person | p in Teacher implies p in Class\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | some p : Person, g : Group, x->p->g\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sZoS8qNeMDA8EPi7q", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:25:02"}
{"_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": "KJWfqgKFgkuudhrZn", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class {\n    t->c in Teaches\n  }\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7vxpCCKuakPWdKiF6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:44:02"}
{"_id": "sEJntyjazvMaDXwH9", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c:Class, t:Teacher | some g:Group | 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\n}", "derivationOf": "wL95TjK9W8hucaNqe", "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": "2020-10-28 16:04:56"}
{"_id": "wfxuYQyTE9DwLgSq6", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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": "Y95p8i3BHfrNaTQyW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 21:13:21"}
{"_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": "ddiFauBZPoKTSwBcy", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno 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\tall x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n  \tsome c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher | all c : Class | all d : Class | x->c in Teaches and c!=d implies x->d not in Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t : Teacher, y : Teacher | all c : Class | t->c in Teaches and y->c in Teaches implies t=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | s in c\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AxA7v6uBBMLtF9diz", "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-10-29 10:40:18"}
{"_id": "PKCnW8DdSro9c7dwy", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HdfBKJE8EGLZpCgFD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:19:51"}
{"_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": "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": "SwNXphQFeMv8rHogX", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 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": "uW9QcnWZdbDTCXgRP", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:10:55"}
{"_id": "C8FbhNEhdGW2stka4", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group | (c -> t -> 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": "NJPYPraBiovZn4cM6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:30:47"}
{"_id": "4oALBqg4Dqr5tdiMv", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wsG8DfTBmsRTRXPqr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 14:44:29"}
{"_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": "9q2sStMrykYqKaXyy", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | all t, p : Person | (c->p->g in Groups and c->t->g in Groups) implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "D2eMEvxbWBrWjfRzR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:19:06"}
{"_id": "Cpzm6cdCpNi4Nh4Z9", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x 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 x : Teacher | some y : Class | x -> y 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\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = 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\tall 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": "BiEJgudd6LFogT4C6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:47:58"}
{"_id": "tNjHau5rrDtAjkLaP", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Teacher implies p not in Student)\n  or\n  (p not in Teacher implies p in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cjxg4kXhKnBBBqJHY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 18:35:27"}
{"_id": "aMweuf6pf3nuxLfmG", "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 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\nall p1,p2,p3:Person | (p1 in Teacher implies (p2 and p3 in  Student) )or (p2 in Teacher implies (p1 and p3 in  Student) ) or (p3 in Teacher implies (p2 and p1 in  Student) )\n}", "derivationOf": "JiPZX4i492p7t8K2w", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:46:32"}
{"_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": "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": "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": "NS86dRCbvkF5tq3Pi", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person | some 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\n}", "derivationOf": "PYxDdPJTCSbWa3ZKg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 22:17:25"}
{"_id": "RixgDrJLMQJEFRBuz", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some c.Groups) implies (some (Teacher & c.~Teaches))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some (t.Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n  all p : Person {\n  \t(some (p.(~Tutors) & Teacher)) or\n  \t(some (p.(~Tutors).(~Tutors) & Teacher)) or\n\t(some (p.(~Tutors).(~Tutors).(~Tutors) & Teacher))\n  }\n}", "derivationOf": "HMLQxafNRfj6JrTRD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:11:38"}
{"_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": "aTQRpbZuFftFtx2mT", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all t: Teacher | all s: Student | t.Tutors and not in s.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": "hYtGhC28Y66opKXvq", "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": "2020-10-27 14:57:04"}
{"_id": "Db7GFknqQNidEdmNf", "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\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  no (Student + Teacher)\n  \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "23XY3Dpa5L8rhangv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 20:07:20"}
{"_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": "X3pDdABCkemPsjxCj", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some g:Group |some 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\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | 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": "6DPJMWtMqw65Km3aX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:21:43"}
{"_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": "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": "MG9Kp9EL6AuwdfYdd", "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\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tno (Student & Teacher)\n\t\n  \t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t all 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": "nd5XxgPZw4BdHPXSY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 19:47:36"}
{"_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": "bGbvsxWJmrYD3kAcB", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 c: Class | all t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BfphZGpwAXjGv5mjq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:39:47"}
{"_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": "4prCwwpgPaY3TWXqr", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nR8JsMTTySuudEhio", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 14:31:18"}
{"_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": "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": "QTMZ5xi9ZmhFCK32v", "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-10-30 18:50:56"}
{"_id": "ifTojJpsYdkj6XMta", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  some c : Class | some t : Teacher | all g : Group | 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": "Mix8brNxL2e7G5TS9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 19:03:26"}
{"_id": "A9jMMNoKpg674RAFT", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 | all c:Class | some t:Teacher | t->c in Teaches and 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/* all p1,p2,p3:Person | \n}", "derivationOf": "nRQgwSmEuHoaFyY3n", "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-10-29 10:23:02"}
{"_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": "shpzAsTbXhqyc789A", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\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=t || t in (p.Tutors) || t in p.Tutors.Tutors\n}", "derivationOf": "SAWzBdh7u6Tm4zGRb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-31 00:09:11"}
{"_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": "uLN75vk8iMFwueEML", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BWaCtHatBWhdK38wx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:33:44"}
{"_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": "MfzYjP8qkhtZGLAif", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x 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 x : Teacher | some y : Class | x -> y 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\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | some t, x : Teacher | t -> c in Teaches and x -> c in Teaches implies t = x\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* 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 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": "k4gz2Rugso2Bsrg2k", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:48:51"}
{"_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": "vTC8sfYGSGAFR4bPi", "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 p : Person, c : Class, g : Group | p in Teacher implies c -> p -> g in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YNmXtKDr5Qnhd5ydk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 14:07:08"}
{"_id": "DWfL8EstZPhX2N4oP", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(all c:Class | some s:Student, 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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "d3epFCcgGYi3kHqaz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:33:00"}
{"_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": "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": "Thzs2vwNrNPMyG9jt", "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 Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\tall c : Class, p, p1 : Person, g : Group | (p -> c not in Teaches or p not in Teacher) implies c -> p1 -> g not in Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "Lzt3LfMjNwKAPGRPD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 02:47:04"}
{"_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": "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": "3Az45cAa4ZtuFvpTN", "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/* 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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all s : Student, t : Teacher | 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": "FQ4Tbg6i6aEjYBF9W", "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-10-29 09:36:26"}
{"_id": "LoNqnEfREiBpaC2dH", "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 = Student\n}\n\n/* 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 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  Person = 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": "ZmuaPfuMzSAfzrb9f", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:08: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": "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": "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": "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": "RmuiuMMGxmXdTQA5m", "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  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, p : Person, g : Group | c->p in Groups implies p->g\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gJChH6vjtqmcECWmx", "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-10-28 18:54:51"}
{"_id": "rGrfnAkLzaJeyP6Xx", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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 | some g: Group | all c: Class | 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": "bRfk9u2LsXakzo9K8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:09:47"}
{"_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": "LETcdFei84usSZWqt", "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 Teacher implies p not in Student) and (p in Student implies p not in Teacher)\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 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\t all s : Person | some g : Group | 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": "sM7pxxYprSyJEtjzL", "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": "2020-10-27 14:02:27"}
{"_id": "dZRbPZSXaWiymxdKv", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  one t: Teacher | lone t.Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fhncNB6PuYbSYSsrs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 14:47:35"}
{"_id": "WALmDdEkZ3ha7jgZe", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Person, g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x 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": "mxCokJYo4dc3S7zDn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:53:44"}
{"_id": "359SpJSSuBH3qpE3v", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (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\tall p1,p2:Person | p1->p2 in Teaches implies p1 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": "uyBnAR8soc8A7LpGn", "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-10-29 09:32:11"}
{"_id": "tEkcBaHr8d6S3P7fi", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all t : Teacher, s : Person | t->s in s.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": "YH3ANm7Y5Qe5dSYem", "msg": "The name \"tutors\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 18:53:18"}
{"_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": "G2kZemCbmABtTPSKw", "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 Person in Student and 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": "s5sptA7qCp7eykicC", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-22 10:28:04"}
{"_id": "nom8LvyR9ze25dE8F", "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": "pYYrZujv3qvZYNSs5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 20:48: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": "srJZ5TS2dsSNGHbnk", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 t: Teacher | some 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 p: Person | all s: Person | p->s in Tutors implies p 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 | some g: Group | all c: Class | 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": "rGrfnAkLzaJeyP6Xx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:12:08"}
{"_id": "MMPms9xHfEwAwPCqg", "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 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 | 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,t2:Teacher | all 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 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\t\n   all t:Teacher | some c:Class | some 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\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": "AQruDZmAAjDf5MTsY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:29:33"}
{"_id": "gtL9hpCZhrwsYiftx", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (some t : Teacher | t->c in Teaches )\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\tall t : Teacher\n  \t\t| (some c : Class, p : Person, g : Groups\n  \t\t\t| c->p->g in Groups and t->p in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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\tall p1 : Person | (p1 in Teacher) or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher) or\n\t\t\tsome p3 : Person | (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher)\n\t\t)\n  \t\t\t\n}", "derivationOf": "35jENGmBWk9FnT87t", "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-10-29 09:29:02"}
{"_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": "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": "n6P2Y4LjGrgtLZXaE", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all p1, p2 : Person | some c : Class | some g : Group | p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->c in Teaches and p2->g in c.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 p1,p2 : Person , c : Class| p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->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": "QTWroBsJLQt86EqhG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:16:43"}
{"_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": "NCnp5qq4nanYaRM6S", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (some t : Teacher | t->c in Teaches )\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\tall t : Teacher\n  \t\t| some c : Class, g: Group, s : Student  | t->s in Teaches implies c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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\tall p1 : Person | (p1 in Teacher) or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher) or\n\t\t\tsome p3 : Person | (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher)\n\t\t)\n  \t\t\t\n}", "derivationOf": "JC4niXheTNGZud4GA", "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-10-29 09:26:59"}
{"_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": "c8Cs6gzsLuYeDu2bg", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some c.Groups) implies (some (Teacher & c.~Teaches))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some (t.Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n  all p : Person {\n  \t(some (p.(~Tutors) & Teacher)) or\n  \t(some (p.(~Tutors).(~Tutors) & Teacher)) or\n\t(some (p.(~Tutors).(~Tutors).(~Tutors) & Teacher))\n  }\n}", "derivationOf": "iY6dNPzPHjjdzdDcX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:11:23"}
{"_id": "bpoY3FvCX2H2QkwoT", "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 f : Person | f in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall f : Person | f not in Teacher\n}\n\n/* No person is both a student 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": "WqspDqEqi39kzijPP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:39:21"}
{"_id": "ZffYnnuXJRBxBiLvo", "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 x : Class | (some p : Person, g : Group  x->p->g in Groups) -> \n(some t : Teacher | t->x in Teaches)\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": "Q8fqWRcgTTw7dPsnN", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:18:32"}
{"_id": "taMPifSTfvbF2KHWD", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 | all t: Teacher | t.Teaches.c\n}\n\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ccHK5kXJsgRL3Fpxw", "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": "2020-10-29 09:36:17"}
{"_id": "AxKhuq4857RMureDm", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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\tall t: Teacher | some  c: Class | some g: Group | all p: Person |  t->c in Teaches implies c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RiqzZTvWoCtJ9oQqj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:30:59"}
{"_id": "DSrnvSmvEyYEAAhW7", "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, 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 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\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": "QFcsDxr6AefLRAZHk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:22:11"}
{"_id": "tCNHpM6pgmhpj26Z9", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s:Student | all t:Teacher | all c:Class | 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\t\n}", "derivationOf": "2khd5NDN8jZqbLNeh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:36:35"}
{"_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": "8fEbSFk4DTWfjtgTC", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t : 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": "gMzT3FjFWkGLakxC5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 19:01:04"}
{"_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": "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": "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": "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": "d725ug3TZr2SPvv5z", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall 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 Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | some t:Teacher | some 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\n}", "derivationOf": "n6WdbL6Z6Dg35eYya", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:51:45"}
{"_id": "Xcob8sd8yAdB6YAqu", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tsome t: Teacher | all s :Student|some g:Group |some c:Class | 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": "gjCfQtZJMvEWtghpP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 12:56:58"}
{"_id": "N5iT3wsdx2N3842Ge", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 (Person-Student-Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t:Teacher | some t.Teaches\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some( c.~Teaches & Teacher) \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s : c.Group | some s \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NQKJcDnCmp2wztShD", "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": "2021-1-13 18:26:46"}
{"_id": "oy8RpzrMwNNdS8Ywy", "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\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tno (Student & Teacher)\n\t\n  \t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t no Student and no Teacher and some Person\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DkcpgKwSe5znFRtz4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 19:45:44"}
{"_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": "DQHn3uBdXsovcHzh7", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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  some c:Class ,g:Groups ,t:Teacher| all s :Student | c->(s->g) in Groups  and t->c in Teaches \n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nfRJNmZ7CK9TpJhdw", "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-10-27 14:14:04"}
{"_id": "C3PRthMDtPXchMzRs", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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\t\n  \tall t:Teacher | some c:Class | (some g:Group c->t->g in Groups) implies t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by 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}", "derivationOf": "waCEJh7SisHMZRMAR", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:44:26"}
{"_id": "MQvnKyvSFvoEbLsT6", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student, 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": "G4umFW9nHyubNirtg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:28:00"}
{"_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": "pJwLcQGi9474Abvtk", "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  all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n  \n  no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "J7koAZb9Z6HsTiwf5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:32:48"}
{"_id": "k5rYkR3CzsHPdhTpC", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nDPq4N5darEJLa2QX", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 14:27:49"}
{"_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": "DRwr8SxSuugzve6Cv", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, p : Teacher | 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": "wGHzK7WzPhcD7myNi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 21:13:43"}
{"_id": "obmmHhkYTxiQiwiYG", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  all c : Class | some t : Teacher | 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\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9mZjS9Qu7N7jJ2Wts", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 15:30:10"}
{"_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": "HdfBKJE8EGLZpCgFD", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p 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": "rpCaaQwa5oZdJKkRu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:19:44"}
{"_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": "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": "WsG57njkWfWHR3H7f", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (some t : Teacher | t->c in Teaches )\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\tall t : Teacher | some c : Class, p : Person, g : Group\n  \t\t| c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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\tall p1 : Person | (p1 in Teacher) or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher) or\n\t\t\tsome p3 : Person | (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher)\n\t\t)\n  \t\t\t\n}", "derivationOf": "gtL9hpCZhrwsYiftx", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:29:31"}
{"_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": "bMpMrjmZvJ3q5GxWb", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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(some p, p2, p3 | p1 != p2 and p2 != p3 and p3 != p1)\n}", "derivationOf": "ZTuJZBsrepMWhMmvA", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:53:45"}
{"_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": "fi7yzAKhtye5exb5L", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group | 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": "kgHKyf6DsmjBdFC6F", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:12:23"}
{"_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": "Pasyuc8kexXxSmp2L", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student, 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {  all f,l,u : File | f->l in link and f->u in link implies l = u \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": "NvGbKaJ3micxZTe8a", "msg": "The name \"File\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:44:28"}
{"_id": "Q8fqWRcgTTw7dPsnN", "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 x : Class | (some p : Person, g : Group | x->p->g in Groups) -> ( some t : Teacher | t->x in Teaches)\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": "sFi8xBDqwJKvEhbsG", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:17:06"}
{"_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": "tHBniXay6kd9pECyA", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(all c : Class, s:Student, g:Group | c->s->g in Groups implies all t:Teacher | t->c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t(all 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\t(all 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\t(all s:Student, g:Group, c:Class | some t:Teacher | 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": "tdxL6PgziXo7NfAoE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:52:26"}
{"_id": "B6uu7hKEeKg93ynkj", "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\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": "tzPzvPovNksXYjgtz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:01:37"}
{"_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": "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": "ALczyiQnAidx5bCzB", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches implies (some g:Group |some p:Person | 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\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "rps9Gr7ABvBzaE7ZH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:31:23"}
{"_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": "icyCwb4QSXStYHWXu", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some c:Class,g:Group | t->c in Teaches and t->g in c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "T8vRy6gHh7ybvtJY5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:08:39"}
{"_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": "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": "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": "kfuntJStgmQK72dK7", "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, 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\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fMuSsJxsDtpijezXd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:12:19"}
{"_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": "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": "N3fDMAfQRRTDoTaEN", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (some t : Teacher | t->c in Teaches )\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\tall t : Teacher\n  \t\t| some c : Class, s : Student, g : Groups\n  \t\t\t| c->s->g in Class\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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\tall p1 : Person | (p1 in Teacher) or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher) or\n\t\t\tsome p3 : Person | (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher)\n\t\t)\n  \t\t\t\n}", "derivationOf": "NCnp5qq4nanYaRM6S", "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}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:27:41"}
{"_id": "EwdRhJiTfBhWuW3hj", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all 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": "kpPgMnLnbkAmWvQmc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:11:47"}
{"_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": "Mfhp6kdwsHvaJtjHa", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some c.groups) implies (some (Teacher & c.~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 p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* 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 \"groups\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2021-1-13 17:03:40"}
{"_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": "FdkjGiFeJqhYK49Yt", "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 p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g) implies (p1->p2 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": "yRvoMa6JRiq2zG2ph", "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-10-29 10:08:51"}
{"_id": "upRzBxEnopHbGEKfD", "cmd_i": 11, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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  implies (some c:Class | t->c in Teaches) implies (some g:Group |all p:Person | 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\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "p3hJuKvQ3SpwKDZHa", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:36:02"}
{"_id": "gyG47bvL4LBRYEjaG", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sTtE3mqC6NXHKYaR3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 21:39:15"}
{"_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": "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": "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": "p4CvdfT3Hgkv23mmf", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, g : Group | some c : Class, t : Teacher | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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": "umJk2foETKRumukSH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:51:50"}
{"_id": "j6tDr6Sawd7ejvhpK", "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 | 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": "tZJsoNEGvfLG7Fu5w", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:15:29"}
{"_id": "CKRkct6MCPADorHNP", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, p : Person | p -> c in Teaches and 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": "cdyNcq9L7n6svA8CN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 21:01:42"}
{"_id": "umJk2foETKRumukSH", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, t : Teacher, g : Group | some c : Class | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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": "DasmKko3JzCKH2fN2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:51:19"}
{"_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": "crY2igeyQn2Q7jZPW", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 g : Group  |  c -> s -> g in Groups) and  some t : Teacher | 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": "SwNXphQFeMv8rHogX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:12:21"}
{"_id": "wcvHRvx8rGoyryjKi", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall x: Person, t: Class | x->t in Teaches implies x in Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->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": "zZeqwnz3G6bKbPLik", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:44:13"}
{"_id": "H6r5qA5Jgzq8ua8dT", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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 = 3\n}", "derivationOf": "zMx9HLZo2CmTF2hJo", "msg": "== is redundant, because the left and right expressions are always disjoint.\nLeft type = {this/Person}\nRight type = {Int}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:48:19"}
{"_id": "k8E7EHtg84m9DrgET", "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  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 { \n    all p : Person | p in Teacher or p in Student\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zLXpSqbZHGX38qXzP", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 18:38:49"}
{"_id": "cD3kxdQSp2XckQKYL", "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\t(all 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\t(all t : Teacher | all c,u : Class | (t->c in Teaches and t->u in Teaches) implies c=u)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(all c : Class | all t,u : Teacher | (t->c in Teaches and u->c in Teaches) implies t=u) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t(all c : Class | all s : Student | some g : Group | c->(s->g in Groups) in Class)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CoYq6jRPSaAAJxBsY", "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": "2020-10-28 22:56:31"}
{"_id": "xjpr97s26h5KA7Yqx", "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 s : Person | s 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": "qiLT6LFjK7Pep8F3J", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 19:27:19"}
{"_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": "HXK7P9LQ4eqZBjRq6", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tall s :Student | all c:Class | (some g:Group | c->s->g in Groups) implies  (all t:Teacher| t->c in Teaches implies t->s in Tutors)\n  \n  \n\n}\n\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 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "tb6JAoGcggkaQoY6c", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:20:09"}
{"_id": "uiuKFAQ2dwnD647nv", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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, g : Group | some t : Teacher, c : Class  |  \n  \t\t(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": "hzeifNip9PWERz2Bg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:58:42"}
{"_id": "ntw8eb8pzNNH5LdP9", "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\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nnWgh7aocsponF7rQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:03:04"}
{"_id": "DTxv3N78kx45ofHgC", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, g : Group, p : Person, t : Teacher | t -> c in Teaches implies c -> p -> g in Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | some c: Class, g: Group | 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": "9xM9cbHDa8yaryRkh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:06: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": "bH7yHR9ncEvJ7Xrtc", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> 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/* 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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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": "ju7AYgLcpciw526Nj", "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": {"Group": {"x": 770.2222493489584, "y": 199}, "Person": {"x": 385.11112467447913, "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"}], "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"}], "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"}], "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-10-28 21:51:16"}
{"_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": "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": "C6Wm76nqtXHhzCKHL", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\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 -> p1 in Tutors and (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": "D8z74GBvEFfMrNXgc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 22:43:51"}
{"_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": "Xq794qDXGeSHnhyMr", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4c7eramC6eDc7GLWG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:37:55"}
{"_id": "2tCeEA4dfRaBYCijR", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "Zwb42RBqtQWH6MMCH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:17:52"}
{"_id": "p5QBtniN3Tptjc5Md", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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\tall p1, p2 : Person\n  \t\t| 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, g : Group, t : Teacher\n  \t\t| 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": "KMkPGnAPnyTSbzDrF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 21:29:15"}
{"_id": "Ng3njXHSFjgzHiWpR", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | all s :Student|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\n}", "derivationOf": "XhL8EfwRRtffEomWT", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 13:16:47"}
{"_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": "6edJQpxjLn6bKwA23", "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\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = {}\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mESyY99rYfzuWPdQS", "msg": "= can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {this/Person}\nRight type = {PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:54:07"}
{"_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": "YdAzzPDTA5wSEMsjY", "cmd_i": 11, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class t->c in Teaches implies (some g:Group |some p:Person | c->(s->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\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "msiduxz6qxcqsK4Aq", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:24:57"}
{"_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": "2n6deotAr4gfCWgbC", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 c:Class | some t:Teacher | t->c in Teaches) | 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": "6q2geukmFctccAQXf", "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-10-29 10:29:00"}
{"_id": "u8xqhzcEjth5msL8o", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall t:Teacher |some c:Class | t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\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": "weEduCXvGnszuXeqR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 11:55:36"}
{"_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": "jBkXC8mQGhs5R6d88", "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 p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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 t : Teacher | some c : Class, s : Person, g : Groups | t->c in Teaches and 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": "xxCDvbmPQx7uHZ6wd", "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-10-29 10:19:36"}
{"_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": "m6ZegbFaMMcM9NkvD", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | all t : Person | c->t->g in Groups implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Z36g4GzjnEp8tMrmE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:18:00"}
{"_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": "sieMATwDb4yZnnAga", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (lone t : Teacher | t->x in Teaches)\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "GPeKgzzPtPkh9mz3C", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:50:56"}
{"_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": "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": "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": "QoJy5rRFQ2kkME8do", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all p1, p2 : Person | some c : Class | some g : Group | p1->p2 in Tutors implies p1 in Teacher and p1->c in Teaches and p2->g in c.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 p1,p2 : Person , c : Class| p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->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": "Q6LxnKHeWqbKsSvEs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 19:16:17"}
{"_id": "SCXcstLzQdHZKkFKk", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t, p : Person | (c->p->g in Groups and c->t->g in Groups) implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */ \npred inv12 {\n  all t : Teacher, c : Class | some g : Group | c->t in Teaches\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FHzNzFWvtsNSacvX9", "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": "2020-10-29 10:22:27"}
{"_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": "8RqQ2huXxHq3q5QAa", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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, g : Group | some t : Person | c->s->g in Groups and t->c in Teaches and t in Teacher and s in Student 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": "w7Rmcw8GSSExGbTAf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:17:09"}
{"_id": "iMRMdim75FwvfFMBP", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | all t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\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\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 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": "wJDJRgRThM2bcHWKY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2021-1-12 01:06:25"}
{"_id": "qtEnDNi2yJSAFgmHa", "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\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "439A8z4qJmnz9gYxo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:30:21"}
{"_id": "Wo6eArqWsTHQGMFxT", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\tall c : Class, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n  \t\t\tsome t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c : Class, g : Group\n  \t\t| some t : Teacher | 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": "o53fnFfezWnnhvgCF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 20:07:42"}
{"_id": "bAFPhqJTRQiMBS4DF", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 | some t.Teaches and c.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": "z2uBxRohcAMHpQpwd", "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": "2020-10-27 14:28:58"}
{"_id": "Zwb42RBqtQWH6MMCH", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "wybffWWynojPkyJBb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:17:42"}
{"_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": "rsWcr6X5mbxyJBNzy", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all 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  all t : Teacher | some p : Person, c : Class, 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 p : Person | (some t : Teacher, c : Class, g : Group | t->p in Tutors) implies t->c in Teaches and c->p->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": "5W7obm6Tx4awWy6Lu", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:24:10"}
{"_id": "G7jvGWQx3hnbdueqQ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\tall c : Class, p, p1 : Person, g : Group | (p -> c not in Teaches or p not in Teacher) implies c -> p1 -> g not in Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "uZcB4zW25rcJiZZ3s", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 02:49:20"}
{"_id": "6zfsTcJQR289P2jAh", "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 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": "YoD4BS4zqBRDTz8AA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 23:45:06"}
{"_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": "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": "e5AMMcKsrDsihHhoe", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student | some g:Group,c:Class | c->s->g in Groups implies (all t:Teacher | 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": "GWxF99Yb4We8mr3CE", "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": 235.6999969482422, "y": 199.20001220703125}, "Class1": {"x": 471.3999938964844, "y": 199.20001220703125}, "Class2": {"x": 707.0999908447266, "y": 199.20001220703125}, "Group0": {"x": 235.6999969482422, "y": 298.8000183105469}, "Group1": {"x": 471.3999938964844, "y": 298.8000183105469}, "Group2": {"x": 707.0999908447266, "y": 298.8000183105469}, "Person": {"x": 471.3999938964844, "y": 99.60000610351562}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "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": "2020-10-29 10:28:27"}
{"_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": "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": "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": "yathnc8YbG5QyCfsE", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t : Teacher | c->t->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\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* 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\n}", "derivationOf": "MHpWvHuHPLNRwr4mL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:08:22"}
{"_id": "yDC8WCFT5g9FesrTG", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\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 \n      p1 not in Student and p2 in Student and p2 not 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": "LXq9nj8gSjuSdjMFt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 22:47:00"}
{"_id": "wqADQ7DhQH9QfWM6v", "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 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": "HYB8fhoGYbyWB6L95", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-22 10:24:58"}
{"_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": "ZEfzwZR8aowENnvyf", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\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\t\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": "8ZB5L9P3Dp4tDDxgq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 22:52:28"}
{"_id": "bCJQEwcruAcACdPYq", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x 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 \tall 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": "etRYcms5pmqieqFBL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:35:22"}
{"_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": "Y95p8i3BHfrNaTQyW", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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\n  \t\t| (some p : Person, g : Group | c->p->g in Groups) implies\n\t\t  (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\n}", "derivationOf": "GaEabTzQQLxT4fSR6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 21:08:42"}
{"_id": "HRwB6erjYBsSQtiKs", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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  lone t: Teacher | some g: Group | some c: Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t: Teacher | all s: Student | t->s in Tutors and (not s->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": "nFXYHm4pGRfYHuoat", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:53:25"}
{"_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": "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": "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": "DcT8rLA5vpoZgKgfv", "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/* 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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Person | some c : Class, s : Person, g : Group | c->s->g in Groups and t->c in Teaches and t in Teacher, s in Student\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": "7EavgKdPX4HtZt8sP", "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-10-29 10:09:16"}
{"_id": "Y3BMDq2q4WokJNE6n", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t, p : Person | (c->p->g in Groups) implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */ \npred inv12 {\n  all t : Teacher, c : Class | some g : Group, p : Person | p in Group implies t->c in Teaches\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bFjzf2tySJqr75Dr7", "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": "2020-11-18 17:33:58"}
{"_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": "xFG3ZESzTbfYDbbaZ", "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\t(all c : Class | all s : Student | some g : Group | c->s->g 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\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\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}", "derivationOf": "Q6utmNExcvZRAYdub", "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": "2020-10-29 09:10:54"}
{"_id": "GiKfPf7A5wsQHcQzz", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student | some 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nc9t8snr98E6yMTdK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:26:54"}
{"_id": "evfejhTCrKt9HK3QB", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\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 | 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 | 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,t2:Teacher | all 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  \tall c:Class, s:Student| some 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\t\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\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": "fbPPp466hw78L5EXM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-4 21:18:20"}
{"_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": "uqciWzmQoCSLNKEjy", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, g : Group, p : Person, 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\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\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HzLNtyegPycivWDMz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:08:35"}
{"_id": "BiEJgudd6LFogT4C6", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x 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 x : Teacher | some y : Class | x -> y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = 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\tall 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": "kdW53RESRTxpvAW3k", "msg": "The name \"x\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:47:52"}
{"_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": "EwKFqKQdKayMRXyMa", "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 = Student\n}\n\n/* 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 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\tno Student\n  no 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": "YTdYZfESZ7Kh35Zst", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:03:35"}
{"_id": "JiPZX4i492p7t8K2w", "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 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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  some c:Class ,g:Group ,t:Teacher| all s:Student | 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 {\nall p1,p2,p3:Person | (p1 in Teacher implies (p2 and p3 in  Student) )or (p2 in Teacher implies (p1 and p3 in  Student) ) or (p3 in Teacher implies (p2 and p1 in  Student) )\n}", "derivationOf": "qs5jL854BD42XM68g", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:46:20"}
{"_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": "jeqHpHykpjyvCR4gy", "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": "8PiYPFvtxX5niCnK6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 19:24:28"}
{"_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": "c33QXDkwxiZKwoiTZ", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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, g : Group | some t : Person | c->s->g in Groups and t->c in Teaches and t in Teacher and s in Student 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": "CbSrTdyCCaJPs7Wjk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:31:34"}
{"_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": "evDDgHQTMyGAuN9k7", "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, 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 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\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 p : Person, c : Class | some g : Group | c->p->g in Groups implies\n  some t : Teacher | t->c in Teches implies 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": "uQTSqcuiPimzThNWg", "msg": "The name \"Teches\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:34:54"}
{"_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": "xywEHeuewyucMqKCc", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | some p: Person, g : Groups | x->p->g in Class implies some t : Teacher | t->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": "vB9L75LSvaqXnRaN6", "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}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:22:47"}
{"_id": "uZofRLfs5TAjm5qD7", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, t : Teacher, g : Group | 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\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": "ahFjbP95rPZgoPMnW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:43:18"}
{"_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": "r9vmwFKLXrP6aZLFc", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "ZKkXB4MXhznJg2ukD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:16:50"}
{"_id": "LWp6amdR7edrTg22B", "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 = Student\n}\n\n/* 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 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\tall x : Person | x not in Student implies x 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": "AiKZNXrLEiTE6EcrD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:59:45"}
{"_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": "T6rRJdAWAD7CGKFw5", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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": "6gdAaPsghJPJPeJuy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 19:46:21"}
{"_id": "y5hvQthPTaxETAdMC", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Jnsgcfh4p4m2k2QKx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 15:41:40"}
{"_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": "xG86qPY3QgBDHA5rq", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student | (some c:Class,g:Groups | c->s->g in Groups) implies (some t:Teacher | t->c in Teaches and 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": "T2e877DnQSEK9zHBg", "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-10-29 10:18:26"}
{"_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": "WkXJsAbPT2XNhTYzm", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some p:Person | t->p in Tutors  \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": "Xg2BN6zwszqhMrpz6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:59:44"}
{"_id": "eBYhdWqpLseLyYNXd", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 g : Group |  c -> s -> g in Groups) and (some t : Teacher | t -> c in Teaches and 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": "igDquNbqAgzEN78aP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:21:13"}
{"_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": "M5D9FDxQ5JFXE6ZJ3", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c:Class, t:Teacher | some g:Group | t->c in 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\n}", "derivationOf": "dwQkgoscALztdHopi", "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/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 15:51:08"}
{"_id": "5TzLMFMBJbTb9qadB", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | some 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 p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SqPvQFuskS7G4xL6Q", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:18:26"}
{"_id": "CkzP5LsXMccSxANzK", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\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": "4ymM6bqgATm6YjM7S", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:05:58"}
{"_id": "56pyd9EgYmrdvcg8i", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 |  (all c : Class, g : Group |  \n  \t\tc -> 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": "uiuKFAQ2dwnD647nv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:03:34"}
{"_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": "yKF8yaEwn9ofihvwj", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tsome t:Teacher | some c:Class | t->c in Teaches implies (some g:Group | all p:Person | c->(p->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": "CviJaSmpo9sLB9E9u", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:00:32"}
{"_id": "KdPELo4uHje9jyMei", "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 => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher, g : Group | c->t->g in Groups\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TYBPRvu3872TWMCfN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-30 19:15:40"}
{"_id": "J7koAZb9Z6HsTiwf5", "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  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": "2020-10-29 09:32:33"}
{"_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": "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": "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": "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": "7YH9ebh5ZzcdjxyRq", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some t:Teacher, g:Groups |g in c 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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tiMLyR85TYSPKhka8", "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": "2020-10-27 15:02:09"}
{"_id": "4445ebzG47A8ggFNi", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | all t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\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\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": "bZF5FnmaHrk6mH7yh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-12 01:05:08"}
{"_id": "oAjEJFaPdhtWxF4G7", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher, c : Class | all 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/* 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": "bkaXMq9Xzyqfpai84", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 01:47:07"}
{"_id": "WqspDqEqi39kzijPP", "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 f : Person | f in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall f : Person | f 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": "czdGyppieGu7arTZY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:38:22"}
{"_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": "o8Jpwh3nehR6ja7Hd", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nnot (some p : Person | p in Student and p 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 Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall 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 {\nall 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 {\nall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class, 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": "Nefw9j9PEs8iShgH3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 21:56:18"}
{"_id": "ru5sw3HB5pbjWkskd", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\tsome c : Class, t : Teacher | t -> c in Teaches implies all g : Group, p : Person | c -> p -> g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "qtimdwyWDv2kydLXq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 02:33:40"}
{"_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": "jZyypiPQNubTKtsSp", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some c.Groups) implies (some (Teacher & c.~Teaches))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some (t.Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n  all p : Person {\n  \t(some (p.(~Tutors) & Teacher)) or\n  \t(some (p.(~Tutors).(~Tutors) & Teacher)) or\n\t(some (p.(~Tutors).(~Tutors).(~Tutors) & Teacher))\n  }\n}", "derivationOf": "D3JYLd5DJMEXTaesZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:11:56"}
{"_id": "TMCbQRzB9492XjBq7", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  all c : Class, t: Teacher | t in c\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rSLASFiKsckjWGNgY", "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-10-29 09:31:03"}
{"_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": "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": "f5RfbP7BvvSutrNnS", "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 all 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 Teacher and p not in Student)or(p not in Teacher and p in Student)\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Ca5JJaRYuZswKfhGg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 18:33:42"}
{"_id": "rRpt2bfkbRtCYf6fJ", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\tall c : Class, p, p1 : Persons | some g : Group | p -> c not in Teaches or p not in Teacher) implies c -> p1 -> g not in Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "5kQvptzeK9T3wcFGb", "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-10-28 02:45:12"}
{"_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": "myfM8tejPeRiMPCRZ", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\n  \t\t| some g : Group\n  \t\t\t| c->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\n  \t\t| c->p->g in Groups implies\n  \t\t\tsome t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher\n  \t| 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 p1, p2 : Person\n  \t\t| 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": "PsH3GvnLJhx6co43J", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 20:39:24"}
{"_id": "SZ4FADhSjbEPmMMCs", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \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": "hZkLroivvYdc6Mbv3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 21:20:50"}
{"_id": "37KBiEwwWiDTYXtCF", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Rayw9sPGAzdgwivyu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:12:03"}
{"_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": "aq4mtKuXRzExNWfTB", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 g : Group, c : Class, t : Teacher | \n  \t\t(c -> s -> g in Groups and t -> c in Teaches) and (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": "dmtGa4z9QXpsymGMa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:50:53"}
{"_id": "kpPgMnLnbkAmWvQmc", "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 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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, 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  all 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": "gtBdFgEHquDCMeeDe", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:11:39"}
{"_id": "Nid8GA7bW7RkKmtRg", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | 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": "9oNntZ9QXsnnWDgNX", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:55:36"}
{"_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": "8XWzQrhkXKsL5NG6K", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | all t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bsxzXzSP7HFagtQN2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-12 01:02:04"}
{"_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": "Qvicto6HiouR7v82T", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t: Teacher| some x:Class | t->x in Teaches implies some g:Group | x->g in Groups \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\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": "Sar4Cgfw824qTES79", "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": "2020-10-29 11:43:52"}
{"_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": "W3zMxAS4H8MWEBWuq", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | in Student implies w not in Teacher\n  all w : Person | in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\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": "iCWdGHtiyDb2RTnJC", "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": "2020-10-28 15:11:13"}
{"_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": "shJHbEQJWCEF5aW8y", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student, 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/* 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": "KJb6Tv3NQWjRpS5wj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:45:26"}
{"_id": "QdKSw2EZFaXacwmz7", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, g : Group | some c : Class, t : Teacher | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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\tall p : Person | some p1 : Person | p1 -> p2  in Teacher\n}", "derivationOf": "98dYRRn7nwrAXP6Jw", "msg": "The name \"p2\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 00:08:50"}
{"_id": "fhncNB6PuYbSYSsrs", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  some t: Teacher | lone t.Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HPcMHx8pPYLd2wMy4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 14:47:10"}
{"_id": "9xqWgqK4GuPvLwQCE", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t, p : Person | (c->p->g in Groups) implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */ \npred inv12 {\n  all t : Teacher, c : Class | some g : Group, p : Person | p in Group implies t->c in Teaches\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "b7FQprqM4Xr6ZA2xW", "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": "2020-10-29 10:32:04"}
{"_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": "XpsKxcMHB9aHKLuNY", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 g : Group  c -> s -> g in Groups)  and (some t : Teacher | 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": "i25dK2k45MaucWifT", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:20:19"}
{"_id": "aK9EZX7RWySfoKJoC", "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\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 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 | all 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 | some s:Student, g:Group | c->s->g 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": "iPWb3hdP5hhA4Z67W", "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": "2020-10-29 09:25:49"}
{"_id": "g9iguSoPeWxgoup74", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall x : Person, c : Class | x in Teacher and x->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": "zsrBXSKzzCeBL7Riw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:11:38"}
{"_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": "X49BHZPSCsGxAG5zD", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Person | some c : Class, s : Person, g : Group | c->t->g in Groups and t->c in Teaches and t in Teacher and s in Student\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": "Rdcmws8QpMjPThPHJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:04:21"}
{"_id": "smYdtiyNNuZqjAke9", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s,t:Person | all c:Class | 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\t...\n}", "derivationOf": "AFE9Sse33emvMxdxZ", "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-10-29 10:47:36"}
{"_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": "Wy2nPGGrT5NDLLYfZ", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher, c : Class | all 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/* 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": "oAjEJFaPdhtWxF4G7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 01:47:13"}
{"_id": "54pYy56jC2GL4m7cr", "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 = Student\n}\n\n/* 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 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\tPerson != Student\n  \tPerson != 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": "w7ZMAQ5kd35SK8Acb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:58:20"}
{"_id": "W5rHQG9AFgiLM5wBA", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and 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": "KdeipsvhRvoHiYWr9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 14:08:12"}
{"_id": "ARoPy6GFzaWYvxEzt", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some g:Group |some 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\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n\tall s:Student,t:Teacher | some g:Group,c:Class | 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": "dyFqhheuJxBWS8yda", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:27:31"}
{"_id": "ca4dKmCoPTTZgKpvQ", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->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": "Rozb3j4W8SbToqLRD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:46:09"}
{"_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": "hYtGhC28Y66opKXvq", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all t: Teacher | all s: Student | t.Tutors and not s.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": "YzipqWMZdZNpsdj7F", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:56:57"}
{"_id": "y77XA2wPNz8jRF8J6", "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\tTeacher 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": "rnDkJ7XFSxiNdGRWJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-6-14 22:44:29"}
{"_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": "TuMLQzzfBKr3CJxWX", "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": "4fDJwZMuAG2g6grJz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 19:17: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": "qXPBn9X7inXZfP5dv", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher | all c : Class | all d : Class | x->c in Teaches and c!=d implies x->d not in Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tsome t : Teacher | all c : Class | t->c in Teaches\n\tall c : Class | all 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": "3Tv9LmDgCXnqwZdMh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:31:01"}
{"_id": "RBdYnoMYzi3kr6zkG", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s,t:Person | all c:Class | 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\t\n}", "derivationOf": "HWRJXiDDAF39dJWRQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:48:05"}
{"_id": "ZWFj5uaFzTx859GRh", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | some g: Group | all p: Person |  t->c in Teaches implies c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vdKRTp8768LNZo9To", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:27:40"}
{"_id": "pj5ZSrhEvjSyZekS2", "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 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": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:53:33"}
{"_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": "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": "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": "9Eo77Sg25zKQjys5z", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s,t:Person | all c:Class | 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\t\n}", "derivationOf": "Kp6uwQqT6PFtadKM4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:47:46"}
{"_id": "hdPXKneg7ycvboQ7q", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t 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": "nLa9k9Ckii37357YH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:30:22"}
{"_id": "52auadHiqAFkPgYJL", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher | some y : Teacher | all c : Class | x->c in Teaches implies y->c 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": "fvBRDeg3oNc6G4JED", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:22:37"}
{"_id": "do4KzfsG5CmXdx6Za", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 | all t: Teacher | p->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FB3ey4swMBhzx6ifR", "msg": "The name \"p\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:38:03"}
{"_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": "5vnkKadHwtY9Fn8Ln", "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\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": "QtaDy7wKzGTEDmMrM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:04:25"}
{"_id": "TPPRt3XJCdemiKi8s", "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 p : Person, c : Class | some g : Group | p in Teacher implies c -> p -> g in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nKbBwexACQqgnBHZH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 14:06:13"}
{"_id": "gzGwQuhqSMfSLwWmh", "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": "JASAepyW9eg8TyDAm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-9-30 09:57:48"}
{"_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": "W2JEsPGaTb9rGS62o", "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\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tno (Student & Teacher)\n\t\n  \t\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 and no p.Teaches and no p.Tutors\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2nbRhq8L97qTbDkg8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 20:09:40"}
{"_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": "YcBgDj3Cj2Z6ywXEz", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tsome s :Student | some c:Class | some g:Group | c->s->g in Groups and (some t:Teacher| t->c in Teaches implies t->s in Tutors)\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "5dmBQdag4unR6mf3t", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:00:43"}
{"_id": "T2e877DnQSEK9zHBg", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student,t:Teacher |(some g:Group | c->s->g in Groups) | 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": "knxhQneaREJaAjnZ9", "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-10-29 10:16:23"}
{"_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": "25vmLCb4pTEHnKuri", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by 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 c:Class,t:Teacher | t->c in Teaches and 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": "dtYTCkeAdRs6w6hMA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:18:46"}
{"_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": "sXMwLAFALYMmefsk8", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Teacher | p.Tutors in Student and p.Teaches in Class.Groupss[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": "pe3NGe4634BNyqQBB", "msg": "The name \"Groupss\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 15:16:33"}
{"_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": "hfoEuFh5ew2cbSA6S", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Cj8xspSMWXmRi7RHL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:46:42"}
{"_id": "4WCMWSKSRADjCZiBA", "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 = Student\n}\n\n/* 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 x : Person | x in Student implies x not in Teacher\n\tStudent != 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": "rFujq7pHqN4Crfy9b", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:57:26"}
{"_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": "kjMECRL2y8rmEfqKn", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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 | some g: Group | some c: Class | 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": "NfxpZuhC2dGpyqhLC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:07:20"}
{"_id": "NNSECps6hNLNkGYZy", "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\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": "AjabSK7FqggGWue8y", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-6-14 22:44:57"}
{"_id": "M9dHrz9bSWkAbc8Y7", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4aGAP5nJuhpwHyRdj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:47:34"}
{"_id": "eqoYAbLpmvh546fL4", "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  { all x.Class | some p.Person, g.Group: x -> p -> g in Groups implies some t.Teacher: t->x in Teaches}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FW7RqgcDzwgiZ8QAk", "msg": "There are 1 possible tokens that can appear here:\n}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:29:14"}
{"_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": "hPa3dT7DfqK7AQEAT", "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\tnot (all p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mhKzcdhWpXu44yA3G", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 19:42:41"}
{"_id": "CDGBN28yPnBaaLR3n", "cmd_i": 10, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->(p->g))  implies (some t:Teacher | t->c in Teaches )\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  all 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\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 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "eHkfrFbRSceCGpeai", "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-10-29 09:20:17"}
{"_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": "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": "wLHxhsFNnnRygMWrz", "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 p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Person | some c : Class, s : Person, g : Group | c->s->g in Groups and t->c in Teaches  t in Teacher and s in Student\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, g : Group | some t : Person | c->s->g in Groups and t->c in Teaches and t in Teacher and s in Student 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": "zLzHSzqo2dPC8D6KK", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:12:26"}
{"_id": "n48N7XkpQvstMsQyp", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\tall c : Class, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n  \t\t\tsome t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c : Class, g : Group\n  \t\t| c in Class\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uz46wCqTcamur5Lqf", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 20:07:00"}
{"_id": "HjJ4L9iKkmmdAkNBB", "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 = Student\n}\n\n/* 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": "ZT2MN4Qxw39Yr6DTd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-12 00:53:31"}
{"_id": "AxA7v6uBBMLtF9diz", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n  \tsome c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher | all c : Class | all d : Class | x->c in Teaches and c!=d implies x->d not in Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t : Teacher, y : Teacher | all c : Class | t->c in Teaches and y->c in Teaches implies t=y\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": "KexfChHR6vZKwFFB8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:37:55"}
{"_id": "CczekskNpyJAtMd6i", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  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": "4ukcByxCedciZHxg4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:51:44"}
{"_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": "B7ZEQa8RPif528qQw", "cmd_i": 13, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tsome s :Student | some c:class | some g:Group c->s->g in Groups and (some t:Teacher t->c) implies t->s in Tutors\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "3BH4wxf8WPaMPeo4z", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:52:06"}
{"_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": "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": "msiduxz6qxcqsK4Aq", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  implies (some t:Teacher | t->c in Teaches )\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  all 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\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 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "CDGBN28yPnBaaLR3n", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:20:40"}
{"_id": "eD8ybG7RSmTAcGj24", "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  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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "833scFvnDaDJk2JS8", "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": "2020-10-29 10:15:19"}
{"_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": "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": "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": "P9jBQHH54LRXS57An", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x not in Teacher\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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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": "pQzJQ7vGx3macpaas", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:59:26"}
{"_id": "i23hGipndA86inx4t", "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": "sbXoYe2A6jATKGrEw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:14:11"}
{"_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": "E33meyDRBAnb8ivWh", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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 p1, p2, p3 : Person \n  \t\t| (p1 != p2 and p2 != p3 and p3 != p1) implies\n  \t\t  ( (p2->p1 in Tutors and p2 in Teacher) and\n            (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher))\n \n}", "derivationOf": "GvZBFnMHAva2oiKYb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:55:50"}
{"_id": "TiD7ymTAo9gGoyMey", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches implies not (some g:Group | all p:Person | 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": "HNbYxc6HQfLYPiYma", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:57:53"}
{"_id": "w7ZMAQ5kd35SK8Acb", "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 = Student\n}\n\n/* 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 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\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4WCMWSKSRADjCZiBA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:57:29"}
{"_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": "jEMA369qQEwAG4v5M", "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\t(all s : Student | some g : Group | all c : Class |  c->(s->g) in Class)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eB7E8wAXk4SGR6rzN", "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": "2020-10-28 22:59:58"}
{"_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": "iDaQ3F4Zcxk3Eefaa", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t(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\t(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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\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}", "derivationOf": "hyN22HWXdaDXmbHRN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:16:00"}
{"_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": "TJ6LPc8K95gMK8i5Y", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | lone c: Class | some 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 p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "N5PaE2YegPRTXgjYs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:17:43"}
{"_id": "cns7Cxo6QPmp2ijGf", "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": "2020-10-28 18:32:53"}
{"_id": "NQKJcDnCmp2wztShD", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 (Person-Student-Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t:Teacher | some t.Teaches\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some( c.~Teaches & Teacher) \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s : c.Groups | some s \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "G9pCLXAbwmzHspJeM", "msg": "Analysis cannot be performed since it requires higher-order quantification that could not be skolemized.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2021-1-13 18:25:57"}
{"_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": "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": "aQZT54xKjxHhbuiQS", "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 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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   all t:Teacher | all c1,c2:Class | t->c1 in Teaches  implies  t->c2 in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2: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": "j3bPSaPPzKcG3vzHY", "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": "2020-10-27 12:06:47"}
{"_id": "4KTuGMzCqTxX55nyf", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group, p : Person | 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  all p : Person | some c : Class, g : Group | c->p->g in Groups and p in Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Zf9Dj8z837ZxsmGRk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:18:37"}
{"_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": "nqeWAt8oAx2wbAEWB", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  one t: Teacher | t.Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4oALBqg4Dqr5tdiMv", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:45:39"}
{"_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": "rkpHKsgs3NA3CQNpS", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n/* 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 || t in p.Tutors.Tutors \n}", "derivationOf": "vXGjXWkkLW6TA95hm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-30 22:38:42"}
{"_id": "6cXukdxWY4iBWZSdJ", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall p:Person | some c:Class | c->p in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Person | all 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\n}", "derivationOf": "yzK9kFmBY3tMef5qa", "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": "2020-10-29 09:43:11"}
{"_id": "KHwHxyX6e9hwBmxD7", "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  \n  all p : Person | p in Student\n  \n}\n\n/* There are no teachers. */\npred inv2 {\n  \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  all p : Person | p in Teacher implies p not in Student or 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": "wdiLn4gC6q3bbYBad", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-5 00:51:55"}
{"_id": "2oqwgMWXGYif8yofE", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class,t:Teacher | some g:Group | (t->c in Teaches and 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": "WAbgCCdbt8wrhg4ix", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:11:56"}
{"_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": "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": "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": "iuvybXQfppsb8gEhG", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x not in Teacher\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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all 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  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": "eEmnG8Ym2tDTKJLjC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:05:41"}
{"_id": "j7mEM2Za2JKT5AFnw", "cmd_i": 13, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tsome s :Student | some c:Class | some g:Group | (c->s->g in Groups and some t:Teacher| t->c in Teaches) implies t->s in Tutors\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "TXJTzqcyWozP8NYQi", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:06:56"}
{"_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": "RQFExuvfr2DrNoTP3", "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 => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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": "T2C4MqwNmB75NfsqR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-30 19:24:04"}
{"_id": "YhXphesRP9hGWmMgW", "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 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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n th\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2:Teacher | all 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  \t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n   \n\tall t:Teacher | some g:Group, s:Student | \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,c:Class,g:Group | some t:Teacher | (t->s in Tutors) implies ( t->c in Teaches and\n      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": "evfejhTCrKt9HK3QB", "msg": "There are 5 possible tokens that can appear here:\nenum fun let open pred", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-11-4 21:39:04"}
{"_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": "NudbgoC7KC82byHK5", "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 f : Person | f in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall f : Person | f not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall f : Person | f in (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall f : Person | #(f.Teaches) > 1\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FBxtDGTP9kgAyfJ2M", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:48:07"}
{"_id": "B5Lnafh3fryfbtYiA", "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 {\nno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nnot (some p : Person | p in Student and p 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 Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall 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 {\nall 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 {\nall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class, 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 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\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8Y6sJnt7sjRBR3WwA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 21:57:50"}
{"_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": "5vHkesEmM2dBLrqhj", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall 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\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = 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": "wFvmJioFrb364Mdez", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:34:50"}
{"_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": "XkskqNNvn7FRyx8aF", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \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": "MMSQDgbFrMKz9BkzC", "msg": "The name \"class\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 21:18:34"}
{"_id": "seByf8g6YBWS2EGrE", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (some t : Teacher | t->c in Teaches )\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \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 p1, p2 : Person\n  \t\t| 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\tall p1 : Person | (p1 in Teacher) or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher) or\n\t\t\tsome p3 : Person | (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher)\n\t\t)\n  \t\t\t\n}", "derivationOf": "BgzodBeDWSi5bEDBB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:15:34"}
{"_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": "H8SkEXoSjgbBuQTLJ", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 p1, p2 : Person, c : Class | (some g : Group | c -> p2 -> g in Groups) and p1 -> c in Teaches implies p1 -> p2 in Tutors)      \n} \n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6jWf4d7b3iuWvPpJJ", "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-10-29 10:23:43"}
{"_id": "jTTBp2scqp3aNGe9a", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 | \n  \t\tc -> t -> 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": "kjGTQMRFSimhDXxba", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:41:02"}
{"_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": "EDCBFQbADk2AFxREm", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, g : Group | some c : Class, t : Teacher | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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\tall p1, p2, p3 : Person | (p1 -> p2 in Tutors implies p2 in Teacher) or (p1 -> p2 in Tutors and p2 -> p3 in Tutors implies p3 in Teacher)\n}", "derivationOf": "Xi3q6EMfRmFA4jYxQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:55:23"}
{"_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": "WAbgCCdbt8wrhg4ix", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some g:Group,t:Teacher | (t->c in Teaches and 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": "xSXKDMi8Z8krhbDfE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:10:45"}
{"_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": "cxYPQ6iwjcRQE2MHq", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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 t : Teacher | some c : Class, s : Person | 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": "JGKdbCwPccuZk6j3p", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:18:42"}
{"_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": "2QCmEpRWEzAd9qZBW", "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  all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n  \n  no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n  \tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \n  all p : Person | p in (Student + Teacher)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n  some c : Class ,t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n  all t : Teacher | (#t.Teaches)>0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  \n  all t : Teacher | (#t.Teaches)<2\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  \n  all c : Class |( c in Teacher.Teaches implies #(Teacher.Teaches)<2) \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FrcndW5PLCeDxKKrv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:12:57"}
{"_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": "tKWXZJ3W2Qg3Nk3k6", "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 Teacher implies p not in Student) and (p in Student implies p not in 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\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": "3ZqsGa5e5oSDc2w8p", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 13:45:00"}
{"_id": "ySMupznTNKnTW3TNu", "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 Person\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\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-10-27 19:21:17"}
{"_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": "piPCqPEenrMPm2g7F", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> 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/* 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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\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\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n  \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": "bEX6beEjK37mx5sbh", "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": 686.7937774658203, "y": 132.66666666666666}, "Class1": {"x": 457.8625183105469, "y": 132.66666666666666}, "Class2": {"x": 183.1450073242188, "y": 265.3333333333333}, "Group0": {"x": 366.2900146484375, "y": 265.3333333333333}, "Group1": {"x": 549.4350219726563, "y": 265.3333333333333}, "Group2": {"x": 732.580029296875, "y": 265.3333333333333}, "Person": {"x": 228.93125915527344, "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": "2020-10-29 11:14:04"}
{"_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": "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": "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": "7sGbA2c2ZzQecwRhM", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 { \n  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": "QycGLcbuQbCCKfhnc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:45:05"}
{"_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": "SmEduQN2wdPaJiDHn", "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/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher, some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7pubhyTo48QCAb4nJ", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 18:45:30"}
{"_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": "mNs9T7Lb2Pa5TZyoK", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \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\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": "datFiD8JeAdLWvZte", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 21:24:33"}
{"_id": "duWu9iZ9yD77j2Lzt", "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 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 | 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,t2:Teacher | all 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\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\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": "aS2K55QXi4T5gc6mg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-4 21:00:30"}
{"_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": "cdyNcq9L7n6svA8CN", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, p : Person | p -> c in Teaches implies 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": "5HsPmC3Cs4Tv8F7RJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 21:01:36"}
{"_id": "jDtTSEpX3DTWkY5vu", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone c: 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": "m6MiQTnXtEXfzYqmB", "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": "2020-10-27 14:43:55"}
{"_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": "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": "hDdwxyQeoAtXEeYrZ", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 | all c:Class | some t:Teacher | t->c in Teaches and 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/* all p1,p2,p3:Person | \n}", "derivationOf": "A9jMMNoKpg674RAFT", "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-10-29 10:23:22"}
{"_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": "HYB8fhoGYbyWB6L95", "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 and 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": "yDstzzwHHiApgDW5o", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-22 10:23:40"}
{"_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": "YjnnQ2745qmGkwzys", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | some p: Person, g : Groups | x->p->g in Groups implies p->g 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": "W8zgmQhX8Godd6MiA", "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-10-29 09:19:50"}
{"_id": "6s3xnpE3hP6s6zP3T", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\tall c : Class, g : Person -> Group\n  \t\t| c->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": "YYaSD6nEFnFPLTZ3i", "msg": "Analysis cannot be performed since it requires higher-order quantification that could not be skolemized.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 19:59:22"}
{"_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": "Wj4CgkfaSv8poLGTr", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, g : Group | some c : Class, t : Teacher | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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\tall p1, p2, p2 : Person | (p1 -> p2 in Tutors implies p2 in Tutors) or (p1 -> p2 in Tutors and p2 -> p3 in Tutors implies p3 in Tutors)\n}", "derivationOf": "HB534F9Sx245RjzJD", "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-10-27 23:54:42"}
{"_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": "YHeb3DQYJEAwrM5Ay", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> 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/* 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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "nWf893RQMRWqwkRwt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:53:14"}
{"_id": "7mitjR7r7gaGgMMaZ", "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  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": "yCoAFtnwhhkK4dj2y", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:09:48"}
{"_id": "YYaSD6nEFnFPLTZ3i", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\tall c : Class, g : Person -> Group, t : Teacher\n  \t\t| true\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3bMPzSy4Jr44o4aJ7", "msg": "The name \"true\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 19:58:23"}
{"_id": "siQwwbkbACfmeerFt", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w 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": "t5pC84okue5uzqZhr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 15:23:11"}
{"_id": "zEtpJqMj5Jxessv9W", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group | some t : Person | c->g in Groups implies t->c 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 p1, p2 : Person{\n    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": "vPpcrvgRvm524zjXf", "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": "2020-10-29 09:33:14"}
{"_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": "4s3CkQ89bw5MsjnNd", "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/* 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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student , p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "W8Ff9pvMvaMcZq5yw", "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-10-29 09:12:13"}
{"_id": "pYYrZujv3qvZYNSs5", "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": "Z5RczML253G789Qfy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 20:46:52"}
{"_id": "BQyzdrzhX7mqkNNG8", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p, p2 : Person | p -> c in Teaches and p in Teacher implies some g : Group | c -> p2 -> g\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "PYu7YEx4CpfsuGMGe", "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-10-28 02:29:16"}
{"_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": "w4XdhXQTwZ8B5KBW4", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\n  \t\t| some g : Group\n  \t\t\t| c->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\n  \t\t| c->p->g in Groups implies\n  \t\t\tsome 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": "7RRQaeSHLTNRTfCDD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 20:12:01"}
{"_id": "F7nx6uqtA2aB88MYJ", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c:Class, t:Teacher | some g:Group | 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": "LRky2RmiyZeJ3JEaN", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 16:03:25"}
{"_id": "6aHuDqTg4rcy6dqbK", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\tall c : Class, p : Person, g : Group | some t : Teacher | (t -> c in Teaches and t not in Student) and (c -> p -> g in Groups) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "m38yi5xLhbrPPbiF6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 02:54:14"}
{"_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": "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": "tqZkt9XFhdEyHZvRo", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MQvnKyvSFvoEbLsT6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:29:09"}
{"_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": "MMSQDgbFrMKz9BkzC", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, p : Teacher | p -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies 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": "DRwr8SxSuugzve6Cv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 21:15:57"}
{"_id": "YvqAYKcSmADfzHHSq", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  \n\tall s :Students|some g:Group | g in Class and 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": "9q7Xwg4EH3FFFf9Ku", "msg": "The name \"Students\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 12:19:46"}
{"_id": "tNJnSaGgLKqAQbtDT", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Zxif7TjiW2iaT264v", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:15:55"}
{"_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": "aGr78E2hJDw8Ao43K", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all t : Teacher,s : student, s : Person | t->s in s.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": "MmSEB5nkzoR89scae", "msg": "The name \"student\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 18:59:28"}
{"_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": "8Ez4QT68hRhWntYnm", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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": "4uy6JMXkKbSJox48s", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:51:00"}
{"_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": "PG9zTj78aBDpdsLG3", "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 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\nall p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or (p2 in Teacher implies (p1 in  Student and p3 in  Student) ) or (p3 in Teacher implies (p2 in  Student and p1 in  Student) )\n\n}", "derivationOf": "NM5poJKTpt49wMaMh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 14:48:06"}
{"_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": "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": "nvbRKsg6LuHA7dh3M", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, 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\tall t: Teacher | some c: Class, g: Group, 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\tall p,pp: Person | p->pp in Tutors implies p in Teacher and pp in 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: Person, c: Class | some t: Person | t->c in Teaches implies 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": "jv6F3dfQ6X6AH2ELo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:29:45"}
{"_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": "b4gJgNZWRQ36SP5ev", "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\t(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\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\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": "xFG3ZESzTbfYDbbaZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:11:03"}
{"_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": "Lr3NaXZsYM6xgmfnX", "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\t(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\t(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\t(all t : Teacher | some c : Class, p : Person, g : Group | t->c in Class 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\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": "a4rFnBAWafjqhgkYG", "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": "2020-10-29 09:28:03"}
{"_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": "DMnmAhec8Xja7jK5N", "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\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t(all p : 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": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 22:40:32"}
{"_id": "QWPWEYSnABvcWE59R", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\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\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "n8Ej7hthdZhwfGgG3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:20:00"}
{"_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": "NLxCJao4a2PHs8Gmo", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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 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\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/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fZoMZbKSbewDMsCQ5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:36:47"}
{"_id": "Ht8XTEn2qfHGTmtBa", "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\t\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: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\tall t1,t2:Teacher | all 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": "LwfdAt4ZfHoztKeTS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:12:35"}
{"_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": "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": "9uxGu5NuZSGQ5C36q", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher, c : Class | some g : Group | 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": "2uLujp6o2smsjktKg", "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": "2020-10-27 22:32:18"}
{"_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": "PReiDrJrq4WnmsXdy", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w 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": "siQwwbkbACfmeerFt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 15:23:27"}
{"_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": "YhocyHAGLriRiFcgZ", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student and x 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": "yivbrEKMoXx6PQA4s", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:33:43"}
{"_id": "D6fehfQKXrMXpfthK", "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\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n  \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\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DH2rp4oDnhpxEjJbF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 19:39:39"}
{"_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": "qD2odTRWnt93dC6zQ", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Groups | 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": "fFidosR6j8ZihnicH", "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-10-28 19:00:01"}
{"_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": "AwA3a5QuFriMjPjH3", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (some t : Teacher | t->c in Teaches )\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \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 p1, p2 : Person\n  \t\t| 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\tall p : Person | p in Teacher or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher))\n  \t\t\t\n}", "derivationOf": "jvScdAvJCvJ23fCea", "msg": "The name \"p1\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:09:20"}
{"_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": "KTudisMAQH54ZMce7", "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\t(all 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\t(all t : Teacher | all c,u : Class | (t->c in Teaches and t->u in Teaches) implies c=u)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(all c : Class | all t,u : Teacher | (t->c in Teaches and u->c in Teaches) implies t=u) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t(all c : Class | all s : Student | some g : Group | s->g in Groups and s->g in Class)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cD3kxdQSp2XckQKYL", "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": "2020-10-28 22:57:19"}
{"_id": "2LkbCuYepg7v4vnjB", "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  all p : Person | p in Student\n  \n}\n\n/* There are no teachers. */\npred inv2 {\n  \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  all p : Person | p in Teacher implies p not in Student or 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  all p : Person | p in Student or p in Teacher\n\n  \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some Teaches.Class\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NDJBdmGCukWTnEvLb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-5 00:59:57"}
{"_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": "9xM9cbHDa8yaryRkh", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, 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\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\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mDmQdjfpWAFe2GuZs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:04:48"}
{"_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": "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": "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": "aWFZYHNcbadCx3jNp", "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\t(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\t(all t : Teacher | some c : Class | t->c in Teaches implies all s:Student, g:Group | c->s->g in Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "NpcPwPBtLMMcePM4z", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:22:54"}
{"_id": "hKbDLvBhmSxv5isay", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\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": "ubnxaAwrSFeSuyLw7", "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-10-28 15:12:45"}
{"_id": "QtZGEx8tetH3Y9ttm", "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 | 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 | 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,t2:Teacher | all 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  \tall c:Class, s:Student,  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\t\n   \n\tall t:Teacher | some g:Group, s:Student | \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,c:Class,g:Group | some t:Teacher | (t->s in Tutors) implies ( (t->c in Teaches) 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": "kAyFARd3p5mu4Ao2S", "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": "2020-11-4 22:09:22"}
{"_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": "ZHesWL59aPJ3DmpCS", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\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 -> p1 in Tutors and (p1 in Teacher and \n      p1 not in Student and p2 in Student and p2 not 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": "C6Wm76nqtXHhzCKHL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 22:44:33"}
{"_id": "63BWDSPejGP9tZGZT", "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 => p not in Teacher and p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Ts29oubBt2h9ncDYE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-30 18:55:43"}
{"_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": "MCfcq99reQKxgtRH4", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tsome t: Teacher |some g:group |some c:Class | some 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": "pRjCqzqg6ExXrxAoZ", "msg": "The name \"group\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 12:53:03"}
{"_id": "jjSNxYHxZMJbzm7Af", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZXWrEouA9RtDb5yQJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:03:34"}
{"_id": "zkAsJDFrr8tRJYToT", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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  some c:Class ,g:Groups | all s :Students | g in c\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2aNghFCQ5aWNRwvhu", "msg": "The name \"Students\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 13:56:51"}
{"_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": "SwXYy3yrfvh9pxynr", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher, c:Class | some g:Group, s:Student| t->c in Teaches and s->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\n}", "derivationOf": "sdNseyFvgzNBtWPqN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 14:43:06"}
{"_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": "dT4ochS5YPqwvsQjX", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\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 | 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 | 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,t2:Teacher | all 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 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\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": "dksLfjBLAYC5adz4k", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:18:22"}
{"_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": "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": "eHkfrFbRSceCGpeai", "cmd_i": 10, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->(p->g))  implies (some t:Teacher | t->c in Teaches )\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  all 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\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 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "arBpNRas6KaSr8ycy", "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-10-29 09:18:15"}
{"_id": "zBGMCi32NvzzXMw5o", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\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 | 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 | 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,t2:Teacher | all 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 | 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\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": "2DcWoFTNpfsBazpZ7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:49:47"}
{"_id": "HHaamY2mgreboa4mc", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\tall c : Class, t : Teacher, p : 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  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "PztrHbfej5SSf3kwN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 02:50:54"}
{"_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": "t246KSkzu7zgv84ZJ", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, g : Group, p : Person, 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\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": "tKS4Zcu7CJ2LhLEoL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:08:57"}
{"_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": "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": "zJPmazkXoL3KZHcvG", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group | some t : Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some g : Group | t->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": "uNZyfSjcpdTpr4La6", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:25:08"}
{"_id": "5eX9YQEya6oSBY2DR", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class | t : Teacher, g : Group | c -> t -> g in Groups\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall 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\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = 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\tall 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": "xzHvQmjYucdXk3vcP", "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-10-29 09:43:53"}
{"_id": "8SHHduoiYhZayjHM4", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JXB8q59XRpPjwNvc9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:13:20"}
{"_id": "PdTMhJhoB8aGnXECg", "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  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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x not in Teacher\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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, 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  all 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": "BpJp9WQfimvbpT5iq", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:10:16"}
{"_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": "J5j8hJsXnu7KkHYt6", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(some t:Teacher | all 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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "5XQqBRFXs5wdnDwWZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:22:08"}
{"_id": "rq42tLq4csimCx2Wz", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\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 | 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 | 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,t2:Teacher | all 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 | 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": "JiGRcNP6bB7tY3Q4G", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:47:36"}
{"_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": "uz46wCqTcamur5Lqf", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\tall c : Class, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n  \t\t\tsome t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c : Class, g : Group\n  \t\t| some t : Teacher | c->t->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": "h2cip5s2mjxrcLzJq", "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-10-28 20:06:46"}
{"_id": "dSBtTL7em4y6FpebX", "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": "CdtZz78WQvzJtcNPm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 08:56:36"}
{"_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": "dTKM9HggEJaT2MSY7", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher, g : Group | some c -> t -> g in Groups\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall 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\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = 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\tall 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": "Pa6PPHpH6wmEDgs3P", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:42:51"}
{"_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": "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": "zsrBXSKzzCeBL7Riw", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x 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": "CF5EghxNYiqEbxiNq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:09:52"}
{"_id": "MsmwkRbmBvFiRHeea", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tsome 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\n}", "derivationOf": "DsbL8QTecxTnx2Qdo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 12:54:07"}
{"_id": "C62t8ijqeYw9GTear", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one 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": "2RWXGGYihEoLGNakX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-12 01:00:01"}
{"_id": "SpXGP72HQ67Ba8spW", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some 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": "AxEKqMLvZqhZBp44m", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-12 00:58:47"}
{"_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": "FxXncWJFPoHco4Y5o", "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, 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\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": "XEP7zJdcMt5b6JW6a", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:07:20"}
{"_id": "FwuNgwFp8GoqZ6WBh", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "ceGRz7XrZyvbLSm36", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:15:23"}
{"_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": "5KQbhvBLsWezomFXC", "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 : Student | 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 implies x 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": "HpKau47ZyKtyStNXY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:28:09"}
{"_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": "t6ZkmMcaxzyS7G7YE", "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-10-28 20:55:13"}
{"_id": "N9DAA7CekzfZgd8Px", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | some t:Teacher | some 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": "c6ShJC8ZMWkGDnMtd", "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-10-29 09:53:21"}
{"_id": "jM2FuQatxqXFq2Rfh", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Teacher | p.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": "uaLFzyRKKif9tZdwo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 15:14:51"}
{"_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": "okDFA27pSe3foGqkd", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\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 p1,p2 : Person , c : Class| p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->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": "gBvriZ6xQcwxzLr3e", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 19:18:49"}
{"_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": "SkazxpidzgPdmGN6x", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\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 | 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 | 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,t2:Teacher | all 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  \tall c:Class, p:Person, 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\t\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\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": "w2zCrwzA5DuzJ4jou", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-4 21:09:40"}
{"_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": "NajQMLFyeCX3kTiS7", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "88KaNLxXoaa7RTwrQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:49:12"}
{"_id": "QtaDy7wKzGTEDmMrM", "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\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\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": "7JXgqg35X9nbuYNx3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:04:19"}
{"_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": "TFL3z6D4DYbPdnpbo", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n    all x : Class, s : Student | s in x\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "bCJQEwcruAcACdPYq", "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-10-29 09:37:49"}
{"_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": "kkguprQZLtSGabRGn", "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\t(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\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": "YQSsDyRnoz7Ps6T2k", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:09:30"}
{"_id": "e4TBxrZ8mSAc9H6QW", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all 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\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oeGrySWQwGep3W365", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:27:21"}
{"_id": "WReRAT2CCqoaG4H6i", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | all t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\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\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 c:Class | some g:Group | c->t->g in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tsome  t:Teacher | some 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": "n7cpffXfMjfX2SQqT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2021-1-12 01:07:25"}
{"_id": "LvJbXxHP5mBfgA6Wo", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cH6PzAeMGAEfgQBwM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 21:47:40"}
{"_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": "d3Yx6JyqsYaRBXayy", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group, p : Person | 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  all p : Person | some c : Class, g : Group | c->p->g in Groups and p in Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pfMcsqNL7zcvutGgc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:17:30"}
{"_id": "uH2H6D6Ag2jP25dMj", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all p1, p2 : Person | some c \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 p1,p2 : Person , c : Class| p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->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": "5bDhttdKJHPQcDfDe", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 19:13:42"}
{"_id": "R9moce4phhWf3J2D4", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->g in Tutors)  \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": "WkXJsAbPT2XNhTYzm", "msg": "The name \"g\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:04:04"}
{"_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": "e9vKgFfYBwJfPqonS", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n  all ps : Person, st : Student | some c : Class, g : Group | some t : Teacher | c->ps->g in Groups and t->c in Teaches implies t->st 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": "GNSNfTJPFHkDDHH3o", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 11:32:44"}
{"_id": "BWaCtHatBWhdK38wx", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : PErso | (c -> t -> 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\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8sNSNv9SWkCXXY3xv", "msg": "The name \"PErso\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:33:18"}
{"_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": "tB9mk685L7qon2mxS", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s,t:Person | all c:Class | 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\t\n}", "derivationOf": "H5ANQRQJtE4zwBPsL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:47:50"}
{"_id": "aeFhLsJWBxpHaY6ap", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 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": "crY2igeyQn2Q7jZPW", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:13:18"}
{"_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": "sXex8zjZ4ZT6WtBnn", "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 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": "xoAWtavvtmv3BXb6m", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 23:44:53"}
{"_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": "uEKjHsH6eo5c8AqSw", "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 Teacher implies p not in Student) and (p in Student implies p not in Teacher)\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 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\t all c : Groups in Class, s : Student| some g : Group | s->g in c\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "C6vwPD4cz9qs3yDKL", "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": "2020-10-27 14:06:17"}
{"_id": "hmJJLq4f9pFTwWuPA", "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:Person, c:Class| (some g :Group |c->s->g in Groups) implies  (all t:Person| t->c in Teaches implies t->s in Tutors)\n\n}\n\n/* 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-10-31 19:23:18"}
{"_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": "GkvN4eiznWpo9qaZe", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\tall c : Class, p, p1 : Persons | some g : Group | (p -> c not in Teaches or p not in Teacher) implies c -> p1 -> g not in Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "rRpt2bfkbRtCYf6fJ", "msg": "The name \"Persons\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 02:45:45"}
{"_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": "vsk8wd4KfXdrs3zMJ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\t\n  \t(all c : Class, p : Person | p -> c in Teaches and p in Teacher) and \n\t\t(all c : Class, p : Person | some g : Group | c -> p -> g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "LR5THFY3S84nrtTPD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 03:17:22"}
{"_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": "koYctT7yFepd4kzEQ", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->g in Tutors)  \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": "R9moce4phhWf3J2D4", "msg": "The name \"g\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:04:18"}
{"_id": "MJg9Ge8fXhRkaxT2d", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p not in Teacher implies p in Student)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tNjHau5rrDtAjkLaP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 18:35:57"}
{"_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": "4ZoKitAc8Qi5Jazet", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\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 -> p1 in Tutors implies (p1 in Teacher and \n      p1 not in Student and p2 in Student and p2 not 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": "ZHesWL59aPJ3DmpCS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 22:44:42"}
{"_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": "SJsxYrvHBYxsXtJop", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 | all  g : Group | \n  \t\tc -> t -> g in Groups and t -> c in Teaches) and 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": "WaAHsP45SXTBzCGcR", "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-10-29 09:43:57"}
{"_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": "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": "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": "66JJEQ7yA7RZNq3NW", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tall s :Student | some c:Class | some g:Group | c->s->g in Groups and (some t:Teacher| t->c in Teaches implies t->s in Tutors)\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "RYYnDyDJemSoLXgMK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:59:13"}
{"_id": "yXNFeZgnmpS4CuBDK", "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\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\tno Student and no Teacher and some Person\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ruzttQfrakWEgJ8Tv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 19:36:02"}
{"_id": "uMNG5TaC3e7TZRgXb", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FEGTpRBbKkqTZjDmM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:39:27"}
{"_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": "mj2Xbbkk8AQKCmYYL", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\t\n  \t\n  \t\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n  \tall p1 : Teacher , p2 : Student | 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  \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": "dtYJcrrPXuaBX6Xi6", "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-10-28 03:46:08"}
{"_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": "SgNw4hMJv7XJmWK5L", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher | all c : Class | all d : Class | x->c in Teaches and c!=d implies x->d not in Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TWjT6T6E2TPcJfmMj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:27:49"}
{"_id": "Hz2cYphZiSWxKZSRA", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\tall c : Class, p, p1 : Person | some g : Group | (p -> c not in Teaches or p not in Teacher) implies c -> p1 -> g not in Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "GkvN4eiznWpo9qaZe", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 02:45:53"}
{"_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": "GDy9AWnukEdzpmzGH", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "f2RiLBK7TjhYrqDR7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 02:07:32"}
{"_id": "2eDpG7WzCib3do9tb", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x 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": "JppCw9i4ntpYjhfEN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:46:10"}
{"_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": "9MjZmvBZm3zex8Fuz", "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 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  all t: Teacher , g:Group | some  c:Class, s:Student | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WRhwk3v33ccC4dtSK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-4 22:51:45"}
{"_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": "7hN6Hde8uG4JR52Y8", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n  \tall t : Teacher | all c : Class, 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/* 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": "7RbfrDhq9Sntm2yJ7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 01:56:21"}
{"_id": "QxdCXmc7akCDvve5n", "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/* 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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | t->s 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": "3Az45cAa4ZtuFvpTN", "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-10-29 09:37:10"}
{"_id": "QzTg8jcfrMo5zCq53", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all p1, p2 : Person | some c : Class | some g : Group | p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->c in Teaches and p2->g in c.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 p1,p2 : Person , c : Class| p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->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": "QoJy5rRFQ2kkME8do", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 19:16:32"}
{"_id": "jvScdAvJCvJ23fCea", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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 p1, p2 : Person\n  \t\t| 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": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:04:35"}
{"_id": "8HciBEMe4m7uYPhNE", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some t:Teacher, g:Groups |g in c 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": "DqN6nszYHKnbajkS3", "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": "2020-10-27 14:33:41"}
{"_id": "X8wcgsoTXaKPC3kR5", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class | some t : Teacher | some g : Group | c -> t -> g in Groups\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall 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\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = 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\tall 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": "J4MtksGDmnDKSCY9c", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:44:14"}
{"_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": "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": "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": "vdKRTp8768LNZo9To", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | some 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 p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "23hRS4QxeZXFFZ2Z9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:26:31"}
{"_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": "JSHPuapkLousPQGWk", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jjSNxYHxZMJbzm7Af", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:03:37"}
{"_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": "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": "hJk7qfLDfArWGNBSy", "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 f : Person | f in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall f : Person | f not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall f : Person | f 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\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { \n\tall c : Class | #(Teacher->c & Teaches) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iTCbimHjfj3mD4HYZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:26:45"}
{"_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": "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": "EbT698uRHurjAkWxv", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some 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\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vzPzKWMPif3jXwAqZ", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:54:15"}
{"_id": "FrcndW5PLCeDxKKrv", "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  all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n  \n  no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n  \tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \n  all p : Person | p in (Student + Teacher)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n  some c : Class ,t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n  all t : Teacher | (#t.Teaches)>0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  \n  all t : Teacher | (#t.Teaches)<2\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  \n  all c : Class |( c in Teacher.Teaches and #(Teacher.Teaches)<2) \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EaX3Nfyzx5zPFoipn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:09:45"}
{"_id": "CFLk8HSfzNDTfoHtX", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\t\n  \t(some c : Class, p : Person | p -> c in Teaches and p in Teacher) and \n\t\t(some c : Class, p : Person | some g : Group | c -> p -> g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "TwxN7fD8HkAAmvRaw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 03:18:41"}
{"_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": "wJDJRgRThM2bcHWKY", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | all t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\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\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 | Class->t->Group in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oGz7dj74fedMu96Br", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2021-1-12 01:05:58"}
{"_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": "Qgc3jDnJpdZgCr52w", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\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": "EL9kvRexCiy6bExEi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 21:29:26"}
{"_id": "EM7dvFBhZMbSWfd2q", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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, t : Teacher, c : Class, g : Group\n  \t\t| (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\tall p1 : Person | (p1 in Teacher) or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher) or\n\t\t\tsome p3 : Person | (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher)\n\t\t)\n  \t\t\t\n}", "derivationOf": "8cwhqxE3vA5SvijTR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:35:24"}
{"_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": "SdqLmrNw2rzKTtrhA", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | all t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\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\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 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/* 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 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": "YfRxYfHwnnfeKvAKJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2021-1-12 01:10:09"}
{"_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": "FEGTpRBbKkqTZjDmM", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "n7TAXc7WwM7ANhwx3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:39:25"}
{"_id": "YXYQY7SWExEjgSkYG", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n  all t : Teacher, c : Class  | t -> c in Teaches implies (some p : People, g : Group | c -> p -> g in Groups)\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "vup8o8sEAhf4KvDEP", "msg": "The name \"People\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:17:11"}
{"_id": "9xNgkKctz6uj3kuzZ", "cmd_i": 13, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tsome s :Student | some c:Class | some g:Group | c->s->g in Groups and (some t:Teacher| t->c) implies t->s in Tutors\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "nz9Ri6jziQPxiyWFz", "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-10-29 09:56:19"}
{"_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": "QTZzzkMhS5ou4T5kp", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  \tall x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x 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 x : Teacher | some y : Class | x -> y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  \tall c : Class | all t, x : Teacher | t -> c in Teaches and x -> c in Teaches implies t = x\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, t : Student | some g : Group | c -> t -> 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\tall 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": "ay7kYWr5e2Bn8PkR8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:52:50"}
{"_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": "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": "yX7pdwTS5ruMp4tY3", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tall s :Student, c:Class | (some g:Group | c->s->g in Groups) implies  (all t:Teacher| t->c in Teaches implies t->s in Tutors)\n  \n  \n\n}\n\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 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "HXK7P9LQ4eqZBjRq6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:21:32"}
{"_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": "6i8uTCExztqyqNEJ9", "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 in Groups z\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class, all t : Teacher | c 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": "YDgLoeeqwntvEWrGC", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-11-5 11:02:32"}
{"_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": "9AMB9BAjJ4rTu4yZj", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x not in Teacher\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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all 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": "E9s4gRZqrD49vpTtW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:09:53"}
{"_id": "Pa6PPHpH6wmEDgs3P", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher, g : Group | c -> t -> g in Groups\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall 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\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = 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\tall 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": "84N5L2A7cWjcbCNyX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:42:20"}
{"_id": "kAyFARd3p5mu4Ao2S", "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 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 | 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,t2:Teacher | all 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  \t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n   \n\tall t:Teacher | some g:Group, s:Student | \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,c:Class,g:Group | some t:Teacher | (t->s in Tutors) implies ( (t->c in Teaches) 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": "7u8gWY8nwbFw8ASX3", "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": "2020-11-4 21:41:04"}
{"_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": "kQMG3tnGcj42iQ5dw", "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  \n  all p : Person | p in Student\n  \n}\n\n/* There are no teachers. */\npred inv2 {\n  \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  all p : Person | p in Teacher implies p not in Student or 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  all p : Person | p in Student or p in Teacher\n\n  \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  all t : Teacher | all 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": "mFzqZc4MgazGp33xG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-5 01:07:28"}
{"_id": "GBmej8fXTMBssk4sb", "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  \n all p : Person | p in Student\n  \n}\n\n/* There are no teachers. */\npred inv2 {\n\n  no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n  no (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": "sFJSd4TQWdR6A2SE2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 17:31:56"}
{"_id": "YMRW7RT9F5ovvGxfk", "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": "t6ZkmMcaxzyS7G7YE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 20:55:24"}
{"_id": "b3pEroRPQd3aeems9", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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\t\n  \tall t:Teacher | some c:Class | (some g:Group | c->t->g in Groups) implies t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by 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}", "derivationOf": "AAPJSK5snJJgqYy7N", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:44:56"}
{"_id": "v2kSedRcPkL4CvZPR", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | all  c: Class | some g: Group | c->t->g in Groups implies t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TTj85L9aBJ3RQLrxQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:24:51"}
{"_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": "xxiHCtg32JeHECrqS", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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, g : Group | some t : Teacher, c : Class | \n  \t\tc -> t -> 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": "mDWS9pJ6rZ9eZaXyq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:39:20"}
{"_id": "23RZ8qAG2trzh3wtS", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (some t : Teacher | t->c in Teaches )\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\tall t : Teacher\n  \t\t| (some c : Class, s : Student, g : Groups\n  \t\t\t| c->s->g in Class)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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\tall p1 : Person | (p1 in Teacher) or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher) or\n\t\t\tsome p3 : Person | (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher)\n\t\t)\n  \t\t\t\n}", "derivationOf": "N3fDMAfQRRTDoTaEN", "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}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:27:53"}
{"_id": "FvY2QA4iJjxcPynvR", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\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, 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 c : Class | t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mpXyWXgfA9S5FwNKB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:15:36"}
{"_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": "Jnsgcfh4p4m2k2QKx", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 | c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PaBSdWu8MpwPzbYYk", "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-10-28 15:41:26"}
{"_id": "d2n2LzHBTcSSh8rSE", "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-10-22 10:20:51"}
{"_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": "MBnNyqZAwQZetJ7Me", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches implies (some g:Group | some p:Person | c->(p->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 c:Class | some t:Teacher | 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": "QXz22ZchPt7ZvQkta", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:10:35"}
{"_id": "RM6rngLmaSr7rWjLL", "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 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\tall x : Class | (some p : Person, g : Group  x->p->g in Groups) -> \n(some t : Teacher | t->x in Teaches)\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": "L2pppav5xj4fCvSpb", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:46:42"}
{"_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": "4aGAP5nJuhpwHyRdj", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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\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": "6kb9yv4xPtbeds5Bq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:46:41"}
{"_id": "ydwLuzDbQGjeg54Ge", "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\tPerson = 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": "iFx6ygb6Z8p7dbT55", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-9-30 09:59:26"}
{"_id": "Ljjn8ofnJ3y6XzzmE", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\tall c : Class, g : Person -> Group | c->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": "6s3xnpE3hP6s6zP3T", "msg": "Analysis cannot be performed since it requires higher-order quantification that could not be skolemized.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 19:59:34"}
{"_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": "iFx6ygb6Z8p7dbT55", "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": "4FLLAgyktNQ5sffbe", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-9-30 09:59:15"}
{"_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": "PjxpjBSPZGN4RAYmd", "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 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  all t: Teacher | some g:Group, c:Class, s:Student | c->s->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": "6NG5mr2kXXNFFKf33", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-4 22:46:16"}
{"_id": "RYYnDyDJemSoLXgMK", "cmd_i": 13, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \t(all s :Student | some c:Class | some g:Group | c->s->g in Groups) and (some t:Teacher| t->c in Teaches implies t->s in Tutors)\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "WDmQwAQT7k9RBesjk", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:59:06"}
{"_id": "2fXWAa9f38wMbWwpz", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all p1, p2 : Person | some c : Class | some g : Group | p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->c in Teaches and p2->g in c.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 p1,p2 : Person , c : Class| p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->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": "deZ7noB2kBEzg2Xo8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:16:57"}
{"_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": "iFJDxYjLBxFRosrTa", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t, p : Person | (c->p->g in Groups and c->t->g in Groups) implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */ \npred inv12 {\n  all t : Teacher, c : Class | some g : Group | (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  all 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 c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WL5vauD7TK7DQmp5M", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:24:38"}
{"_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": "H73fiR3X3DgF43kdQ", "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 p : Person {\n    (some (p.~Tutors) & Teacher)) or (some (p.~Tutors.~Tutors) & Teacher)) or (some (p.~Tutors.~Tutors.~Tutors) & Teacher))\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": "2020-11-23 03:53:42"}
{"_id": "Ts29oubBt2h9ncDYE", "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": "h9CtXZN3MgZdtomcn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-30 18:53:14"}
{"_id": "CoYq6jRPSaAAJxBsY", "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\t(all 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\t(all t : Teacher | all c,u : Class | (t->c in Teaches and t->u in Teaches) implies c=u)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(all c : Class | all t,u : Teacher | (t->c in Teaches and u->c in Teaches) implies t=u) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "95TqE6scMwSvmBzmi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 22:53:03"}
{"_id": "o6J3BxvMwuaFRvvAL", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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, g : Group | some t : Person | c->s->g in Groups and t in Teacher and s in Student 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": "C9KSxaftuYe8ZCMy4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:33:49"}
{"_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": "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": "vaJCy9sWp3Q7MjLqc", "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\t(all 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\t(all t : Teacher, s : Student | t->s in Tutors implies 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\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": "XoZNELuCmQ5nrLdQt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:37:40"}
{"_id": "sWaDNAbz8QWFh52bC", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "t33qjfx5gwQSctZbo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:15:09"}
{"_id": "94LZ4wpmqgQfJBu4q", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some s:Student, g:Group, t:Teacher | s->g in 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\n}", "derivationOf": "uwt7h8wR2pTAzBo8X", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 14:21:18"}
{"_id": "saCpRCb3C3vmdMTgx", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eD8ybG7RSmTAcGj24", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:15:26"}
{"_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": "RJ7gWxNPDK8oBowKA", "cmd_i": 10, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class |some g:Group |some p:Person | c->p->g  implies |some t:Teacher t->c in Teaches \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  all 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\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 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "4uRZNosi6d9BJ5Yzp", "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": "2020-10-29 09:16:02"}
{"_id": "rSx7LmdprA3Q93gxM", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \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  all 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 c : Class , s : Student , t : Teacher | some g : Group | \n    ((c->s->g in Groups)and(c->t 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": "xRanWHSMGq6harM2T", "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": "2020-10-29 09:48:33"}
{"_id": "aMJuYHRFiRhxr4hPM", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\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 | 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 | 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,t2:Teacher | all 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 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\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": "NBRpNG6ntviDcDNr4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:19:26"}
{"_id": "yr9zZurZAd8tduJuo", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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  some 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\tall t: Teacher | all s: Student | t->s in Tutors and (not s->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": "5bzWBkJwKFXgnFqmS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:58:03"}
{"_id": "n8Ej7hthdZhwfGgG3", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\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\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "2S5sD2BA5mvLdj46b", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:19:45"}
{"_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": "H5aBt6cMhot6Pm7Te", "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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n\n  \n  all p1,p2,p3:Person | p1 in Teacher implies (p1->p2 in Tutors) implies (p2 ->p3 in Tutors)\n}", "derivationOf": "eurXTgXcFtxvdEyat", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 15:07:02"}
{"_id": "zqcrgF4eLWN2rBLpP", "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\t\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: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\tall t1,t2:Teacher | all 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": "pbvpQ9u5vTNKszKMJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:13:29"}
{"_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": "m27RQnnr8YYhB9PRd", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 | \n  \t\t(c -> t -> 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": "jTTBp2scqp3aNGe9a", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:41:39"}
{"_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": "BDkmLRWsZ3zoHsWtA", "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 {\nno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nnot (some p : Person | p in Student and p 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 Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall 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 {\nall 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 {\nall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class, 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 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 {\nall 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 {\nall p1, p2 : Person, c : Class, g : Group | (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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": "LhHRZe9CiKqSLpSS9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 22:01:33"}
{"_id": "mbWtoDmDgHdHx8jhT", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches implies (some g:Group |all p:Person | 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\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "kgQdZDBKzB4CQcjkC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:41:51"}
{"_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": "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": "dbgmpweFDxdWBy8gH", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\n  \t\t| some g : group\n  \t\t\t| c->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\n  \t\t| c->p->g in Groups implies\n  \t\t\tsome 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": "H93CYc9THBda96otC", "msg": "The name \"group\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 20:11:31"}
{"_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": "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": "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": "kDxXASmKK4KAMXLbd", "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\t(all c : Class | all s : Student | some g : Group | (s->g)->c in Class)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by 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}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group->this/Class}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:04:24"}
{"_id": "EL9kvRexCiy6bExEi", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\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": "KZY3hy6EzyPXrKwoC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 21:27:15"}
{"_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": "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": "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": "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": "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": "ic7drx7d4E86wbJYh", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (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": "ceRs3fk65qQ5RAdS8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:21:09"}
{"_id": "mxCokJYo4dc3S7zDn", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Person| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x 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": "NZmFwyXfMZEZqFfBn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:50:39"}
{"_id": "BfphZGpwAXjGv5mjq", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7obuMxLSjmTPe3DqJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:39:27"}
{"_id": "vPTGaDzh8mdJfQB9P", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t: Teacher| some x:Class | t->x in Teaches implies some g:Group | x->g in Groups \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\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": "v9NHbiMf74eR3La4h", "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": "2020-11-5 11:34:48"}
{"_id": "EztqFwasqjTH8ETeu", "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 => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | some c->t->G\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KdPELo4uHje9jyMei", "msg": "The name \"G\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-30 19:17:24"}
{"_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": "xHm3jLCAdZby6dKvH", "cmd_i": 10, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class |some t:Teacher |some g:Group |some p:Person | c->( p->g)  implies t->c in Teaches \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  all 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\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 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "YH3ANm7Y5Qe5dSYem", "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-10-29 09:14:20"}
{"_id": "Sx6RekmJK45YBacrk", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 c:Class | some Teaches.c\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MRSPZ4BJ7XYyih9PT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2021-1-12 00:56:57"}
{"_id": "Bq5RAqZGPLpxBiGh5", "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/* 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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Person | some c : Class, s : Person, g : Group | c->t->g in and t in Teacher\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": "bGFcSive4KX7mH2xs", "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": "2020-10-29 10:03:21"}
{"_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": "XjvSM9kpP9mfJsNCr", "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 = Student\n}\n\n/* 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 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\tno Student\n  \tno 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": "EwKFqKQdKayMRXyMa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:03:40"}
{"_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": "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": "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": "ofAJYD9M9HrHCzSY2", "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  \n  all s : Person | s 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  all p : Person | no ( 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": "iGZc5uMv6tQQdCfAw", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 19:37:12"}
{"_id": "x35HJE5ba244YexiZ", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group | some t : Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some g : Group | t->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": "qy4mSTek8wKmbGJw4", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:25:39"}
{"_id": "97sc6zvW2S8Em6ZNo", "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  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}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GcRefLTTJuz7RSDdq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 20:05:37"}
{"_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": "YkPgQiNXtb7trbFjx", "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\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\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 \"student\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-9-30 09:57:19"}
{"_id": "gcB8wJbzWXcG5Nioz", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  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": "Syn6cWoiLon6uo7Cn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:22:48"}
{"_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": "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": "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": "rqP7dX7z6qLX6JwEH", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher,c:Class | some g:Group | t->c in Teaches and t->g in c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3QMzoSGryARLh8Qm2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:10:26"}
{"_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": "Z74x3rfw5chxBwZJQ", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 | c->t in Group.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": "pRqAoeA73f9KwwSeg", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person}\nRight type = {none}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:35:27"}
{"_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": "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": "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": "BKf8maW5iRtquXNWF", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "essEkwo3WsMKRBKod", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:04:30"}
{"_id": "ZT2MN4Qxw39Yr6DTd", "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 = 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": "2021-1-12 00:53:22"}
{"_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": "aHzgbBv98Y243xX5a", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, 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\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/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qWk8HxgaBEWtPpvmb", "msg": "The name \"g\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 23:42:38"}
{"_id": "8QjsvnBcJ7LeYcuaY", "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\t(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\t(all t : Teacher | some c : Class | t->c in Teaches implies all s:Student, g:Group | c->s->g in Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "HtmGb24xjDgKNveuC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:14:53"}
{"_id": "Dm5SJK9SAHnAxDaTe", "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\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\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "d2n2LzHBTcSSh8rSE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-22 10:21: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": "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": "Yf4p6uqi8BmRzAJ2m", "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 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": "QWhkSaTnnaFFArHSb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-22 10:27:17"}
{"_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": "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": "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": "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": "FrWZZNSdLtSEQ86f2", "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\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t(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": "4FRCxFJv86rsaemb2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 22:47:22"}
{"_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": "n9F2ag8nNrdjApfEW", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all 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": "4s3CkQ89bw5MsjnNd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:12:29"}
{"_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": "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": "3ReiqcMpQiM4JbxfL", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 t: Teacher | t.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9iK7arnzudQbhagPm", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:22:58"}
{"_id": "K478kyPpPib2WDNSL", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> 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/* 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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->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": "4beRYubzrb7H3TsZz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:31:52"}
{"_id": "NDryhFQa7xAcXHe84", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cwkoSmZL48XcqyF7k", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:04:01"}
{"_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": "NtJ87bQowakBzgbhD", "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 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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all x : Class | some p : Person, g : Group . x->p->g in Group implies (some t : Teacher | t->x 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": "YH3ANm7Y5Qe5dSYem", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:38:50"}
{"_id": "Ggns2PHp6DyKemsdB", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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 p1 : Person\n  \t\t| p1 in Teachers or\n  \t\t  (some p2 : Person | p2->p1 in Tutors and p2 in Teachers)\n}", "derivationOf": "ppou8gEzXerQRHhyT", "msg": "The name \"Teachers\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:41:00"}
{"_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": "vtMCWSD29qQbqkFmW", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student, 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/* 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, g : Group | some t : Teacher | 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": "BM8HcikX2jv2pmiB4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:52:45"}
{"_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": "FvFS2onx6yBTQEBH3", "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 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 all t:Teacher | all c1,c2:Class | t->c1 in Teaches implies t->c2 not in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2: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": "Xugti2BoHNjbAq8fC", "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": "2020-10-27 12:07:55"}
{"_id": "udSXA9NxaeHbcLrdX", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 c:Class | some t:Teacher | t->c in Teaches and 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 p1,p2,p3:Person | \n}", "derivationOf": "GaEYP4mxw7cQjN6CB", "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-10-29 10:13:28"}
{"_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": "vSNkSm3T6aAiJKF8T", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some t:Teacher, p:Person, g:Group | p->g in c.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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bqELzhq3ustvJgHjh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 15:09:57"}
{"_id": "YNhgtEDZJuWBGpfEr", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some c.Groups) implies (some (Teacher & c.~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 p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Mfhp6kdwsHvaJtjHa", "msg": "The name \"teaches\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2021-1-13 17:03:51"}
{"_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": "634pDqZmjdvSQvEFG", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s,t:Person | all c:Class | 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\t\n}", "derivationOf": "TEYWx3MqX9tBAn8zE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:47:56"}
{"_id": "Awk3CjPdAY3pK3jwZ", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all c : Class, g : Group | all t1, t2 : Teacher | c->t1->g in Groups and c->t2->g in Groups implies t1=t2\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zr8WcShmtmXq9HJeL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:24:14"}
{"_id": "344Yxkn2seKbb4ND5", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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\tall p1, p2 : Person\n  \t\t| 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\n  \t\t| (t->c in Teaches and 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": "ocEAHbygvoBHQu2m4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 21:19:30"}
{"_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": "jtfZuw3yvJYqSx2pj", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall x : Teacher | all c : Class | x->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": "wh3cgxR9c5TkxyPuf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:17:28"}
{"_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": "WAoKMF2SykTGdefWJ", "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/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t, p : Person | (c->p->g in Groups and c->t->g in Groups) implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */ \npred inv12 {\n  all t : Teacher, c : Class | some g : Group, p : Person | c->p in Group implies t->c in Teaches\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mLhexx4YNbF3Nxx2E", "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": "2020-10-29 10:28:03"}
{"_id": "4gPPS4GrotKLGphtw", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \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  all 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 c : Class , s : Student , t : Teacher | some g : Group | \n    ((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": "rSx7LmdprA3Q93gxM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:48:51"}
{"_id": "hjfFYBnk4fCggueCf", "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": "Dm5SJK9SAHnAxDaTe", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-22 10:22:39"}
{"_id": "Tpv6juX3grMYLzcGG", "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 = Student\n}\n\n/* 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 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\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x : 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": "Q2NZCfq3H5kHrRsgF", "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": "2020-10-29 10:07:25"}
{"_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": "CXRXYq7azcDSpzrQF", "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\tPerson & Student = Student\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ho7ATgYrBwTnWMguB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-5 00:36:10"}
{"_id": "DasmKko3JzCKH2fN2", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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": "fvX8suc5cD2b5ja8e", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:46:08"}
{"_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": "CbzpoAcnShLh3b5Qe", "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\t(all c : Class | all s : Student | some g : Group | some gi : Groups | gi->c in Class)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by 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}", "derivationOf": "ZAH4jtqh49XgKPBLx", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person->this/Group->this/Class}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:05:45"}
{"_id": "WzTiZEw8JNWgsWgRg", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all 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  all t : Teacher | some p : Person, c : Class, 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 p : Person | some t : Teacher, c : Class, g : Group | t->p in Tutors implies (t->c in Teaches and c->p->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": "XEm5rjQ5z6mkWJSxE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:13:28"}
{"_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": "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": "fHE7B5NTQNz6Ngm34", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group, p : Person | 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  all p : Person | some c : Class, g : Group | c->p->g in Groups and p in Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pRnutuQRqZKSiRBTD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:18:45"}
{"_id": "z69uSq99tJy2oHJQg", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p not in Sudent 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": "3gJtg4ypqZWR2n5yx", "msg": "The name \"Sudent\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 20:57:58"}
{"_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": "TL5dYL6oN6LLbvHEt", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n  all ps : Person, st : Student | some c : Class, g : Group | c->ps->g in Groups implies some t : Teacher | t->c in Teaches and t->st 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": "e9vKgFfYBwJfPqonS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 11:34:46"}
{"_id": "m7AFmLszqomWMeMbs", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group | some t : Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all g : Groups | some t : Teacher | all c : Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TWzJjCWhdYRMo68sw", "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-10-28 19:02:38"}
{"_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": "AAHv6vHXdg78aCv9c", "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, 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 c : Class | t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FvY2QA4iJjxcPynvR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:15:57"}
{"_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": "rh4B9ktiqd5sXTeY4", "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 p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \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  all 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  all c : Class, s : Student | some t : Teacher | ((c->s in Groups) and (c->t in Groups)) 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": "RRthQyznfmuWZ7Lcm", "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-10-29 09:35:22"}
{"_id": "qKKNaSZzWxhJrADAa", "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  all c : Class | (some p : Person, g : Group | x -> p -> g in Groups) implies \n\t(some t : Teacher | 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": "hT76Pcqs68PSakbZX", "msg": "The name \"x\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:17:04"}
{"_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": "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": "7FiypXn7s37Byzszk", "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  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": "cns7Cxo6QPmp2ijGf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:33:54"}
{"_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": "rA6yWBW5q2NwaWbDc", "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\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tno (Student & Teacher)\n\t\n  \t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Person\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ChDyC5gnW9DM54aJg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 20:14:15"}
{"_id": "BwSGGDsL4oE62wwPK", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t(some c : Class, t : Teacher | t -> c in Teaches implies all g : Group, p : Person | c -> p -> g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "jo653NxGCcmgXyzjY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 02:37:55"}
{"_id": "ZGt86y9G2F5J6Kg5G", "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\tPerson not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NNSECps6hNLNkGYZy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-6-14 22:45:20"}
{"_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": "RZz9Tz5TTbdKgymTs", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c:Class, t:Teacher | some g:Group | t->c 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": "buoHa3v2zBkcqHWfh", "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/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 15:50:26"}
{"_id": "Y5RqJMjdGcyPv7soL", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all 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  all t : Teacher | some p : Person, c : Class, 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 p,t : Person | some c : Class, g : Group | t->p in Tutors implies t->c in Teaches and c->p->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": "7QbxJxzM6HZWLtABe", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:38:37"}
{"_id": "JXB8q59XRpPjwNvc9", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "m4hiDS52Tp2BNnJMB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:12:36"}
{"_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": "b3HrBYMAv4jb4wYCw", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | s in g\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SGgA26i2gcxGttCLS", "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": "2020-10-28 18:52:23"}
{"_id": "Z3QerQrMSToEZqGMo", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  always Person in Student implies Person not in Teacher\n  always Person in Teacher implies Person not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  Person implies 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": "z7WRK882LCbLx8CZR", "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": "2020-10-28 14:56:55"}
{"_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": "K46LcPWdhwBCJniqu", "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 p : Person, c : Class, g : Group | p in Teacher implies c -> p -> g in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall t : Teacher, c : Class, s : Student, g : Group | t -> c in Teaches and c -> s -> g in Groups implies 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": "e4aZFy6NW3qtL2iRp", "msg": "The name \"p\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 14:15:25"}
{"_id": "5kQvptzeK9T3wcFGb", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\tall c : Class, p, p1 : Persons | some g : Group | /p -> c not in Teaches or p not in Teacher) implies c -> p1 -> g not in Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "eEPPJHG7ZEAQaRgkM", "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": "2020-10-28 02:45:01"}
{"_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": "t5pC84okue5uzqZhr", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w 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": "5c7ZQZbs8iFrAWRPC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 15:14:44"}
{"_id": "FTP9btEtJKMK8EET4", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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\t\n  \tall t:Teacher | some c:Class | (some g:Group c->t->g in Groups) implies t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by 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}", "derivationOf": "C3PRthMDtPXchMzRs", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:44:38"}
{"_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": "KrT2fxBKayPwng5Gu", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 | all  g : Group | \n  \t\t(c -> t -> g in Groups and t -> c in Teaches) and 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": "QnwrntCAdbvoXXqgq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:44:43"}
{"_id": "Hqatsj5GnaLGqzeTL", "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\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": "pGLNkLFDHmHm82TAM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:59:26"}
{"_id": "LfWo9HwQdC9qzDPf6", "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 { all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 { all t : Person | t 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": "GRtw9FdRmBADCQ8bM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:39:59"}
{"_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": "bNEuLRSaTHKeA36ZG", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p 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": "fdAC6rixGey3i8wo3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:19:38"}
{"_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": "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": "xg2eQoZW4rx7RTFLA", "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  all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n  \n  no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n  \tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \n  all p : Person | p in (Student + Teacher)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n  some 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": "uWFRYpCrgWwqpRt6b", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:55:33"}
{"_id": "bsxzXzSP7HFagtQN2", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | all t,u : Teacher | t-> in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5eJjQaHoLKknqdzXs", "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": "2021-1-12 01:01:56"}
{"_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": "7FWCkKGg7S5oFkG2g", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 p1, p2 : Person, c : Class | (some g : Group | c -> p2 -> g in Groups and \n\t\tp1 -> c in Teaches) implies p1 -> p2 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": "GRSuLtEunFAkAWM97", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:37:13"}
{"_id": "7QbxJxzM6HZWLtABe", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all 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  all t : Teacher | some p : Person, c : Class, 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 p,t : Person | c : Class, g : Group | t->p in Tutors implies t->c in Teaches and c->p->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": "9JPBafj82rqSuGzow", "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-10-29 10:38:28"}
{"_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": "hcNCWEWA5j69BEkEG", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\tall c : Class, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n  \t\t\tsome t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c : Class, g : Group\n  \t\t| (some t : Teacher | c->t->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": "n48N7XkpQvstMsQyp", "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-10-28 20:07:14"}
{"_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": "uWFRYpCrgWwqpRt6b", "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  all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n  \n  no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n  \tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \n  all p : Person | p in (Student + Teacher)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n  some c : Class | some 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": "iWnpAaMuBgvkKQyNw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:55:14"}
{"_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": "Yya3EGt2rk5s6TpEc", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x not in Teacher\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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all 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": "ae8WQqGyt6NGGH2iE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:06:24"}
{"_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": "PQE5JYL26BmmRFCBX", "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\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(all t:Teacher | some 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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "Bgt7TSmwDcGrAFmKs", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:20:37"}
{"_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": "3W3FX4jNb4ucpRamv", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 p : Person | some t : Teacher |  (some c : Class, g : Group |  \n  \t\tc -> p -> 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": "hghv6NEo9sQDKTebo", "msg": "The name \"s\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:04:28"}
{"_id": "C9KSxaftuYe8ZCMy4", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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, g : Group | some t : Person | c->s->g in Groups and t in Teacher and s in Student implies t->c in Teaches and 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": "3wudnJQZy8N9HB5Cj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:33:36"}
{"_id": "G5kJqCv884jjaQwZW", "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 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 | 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,t2:Teacher | all 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  \t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n  \tall g:Group, s:Student,  t:Teacher | some g:Class | ( t->c in Teaches) implies (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\tall s:Student,c:Class,g:Group | some t:Teacher | (t->s in Tutors) implies ( (t->c in Teaches) 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": "mPts4SgH76xr3TBDG", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-11-4 22:25:13"}
{"_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": "NWRYbNDKArCGJAiw2", "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\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": "3ecS8B2P7MJXEaDZo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:56:52"}
{"_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": "h637csoZ9amHiz3mK", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some p:Person, g:Group | c->p->g in Groups implies p->c in Teaches \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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XJ3dfo7PiaWksvXQ2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:14:40"}
{"_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": "dw3zC9zSfiK5dbisP", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tsome s :Student | some c:Class | some g:Group | c->s->g in Groups and some t:Teacher| t->c in Teaches implies t->s in Tutors\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "YcBgDj3Cj2Z6ywXEz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:04:49"}
{"_id": "qiLT6LFjK7Pep8F3J", "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": "ySMupznTNKnTW3TNu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 19:27:05"}
{"_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": "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": "5XSR6WTYyK67XqHxG", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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": "QKDhkAWFRj8fDj7he", "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": {"Group": {"x": 805.3229166666666, "y": 199}, "Person": {"x": 402.66145833333337, "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"}], "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"}], "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"}], "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-9-30 10:01:12"}
{"_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": "3GNn2PtJ6JxwrDRuv", "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-10-28 19:41:00"}
{"_id": "9jBeMqjnG38Z8igBm", "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-9-30 10:00:35"}
{"_id": "DqN6nszYHKnbajkS3", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some t:Teacher, g:Group |g in 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\n}", "derivationOf": "44kgbtsHyj3nHKPse", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Group}\nRight type = {this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:32:39"}
{"_id": "uNZyfSjcpdTpr4La6", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group | 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": "fi7yzAKhtye5exb5L", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:20:26"}
{"_id": "JBBiN34mXMtHwJoxe", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all 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 | 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\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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "f64zhrz85ZXqdovrT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:44:04"}
{"_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": "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": "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": "Dxe34d7cqZ6nio4My", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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": "u4rGyciYLsrGt3BdS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:36:35"}
{"_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": "cLRCwBbNc7q6KiHDE", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 (Person-Student-Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t:Teacher | some t.Teaches\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some( c.~Teaches & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone c.Teahces\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Yoiri56KrqgqcDyej", "msg": "The name \"Teahces\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2021-1-13 18:22:41"}
{"_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": "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": "meTeqxfTAkxmR9miJ", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student | some c:Class | (some g:Group | c->s->g in Groups) implies (some t:Teacher | t->c in Teaches and 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": "25vmLCb4pTEHnKuri", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:19:17"}
{"_id": "ctvqux7AnoCeujahk", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group| some p1, p2 : Person | c->p1->g in Groups implies p2->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all p : Person | some c : Class, g : Group | c->p->g in Groups and p in Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "N9XSWnwjY5ZsLv2sM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:19:28"}
{"_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": "XkP35wBfMfuYQPwrH", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches implies (some g:Group | some p:Person | c->(p->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": "hKzoxX4SQCjmEjPth", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:01:09"}
{"_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": "H9MJcvDXhtBDC6vkf", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "FQwXvLfsHybyndn3F", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:14:37"}
{"_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": "3Yy9WziiJpakCpug5", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s,t:Person | all c:Class | 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\t\n}", "derivationOf": "4Qyi6sfzrWRBb7jZX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:48:08"}
{"_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": "u8ZX84Za2Mc6sexam", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "J3ovEsuam2MYZBn9d", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:21:35"}
{"_id": "b6rjw2DcrzCoETLW8", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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  some c:Class ,g:Groups ,t:Teacher| all s :Student | (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": "wqBRYAbeovfvNQcav", "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-10-27 14:12:06"}
{"_id": "ZKkXB4MXhznJg2ukD", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "CwcPkNKjGvf87CpYw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:16:30"}
{"_id": "XEP7zJdcMt5b6JW6a", "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, 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\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": "uen4TtmacMdeMsmg7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:07:16"}
{"_id": "eFXuR4HjqFEkcyFvq", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Groups, p : Person | c->p->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": "Qog4g4Mh3fYhepfPQ", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Person->this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:18:08"}
{"_id": "GzYCTPvuuCAuaNC7W", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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": "x2NHqrBmzxdx5Jiix", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:48:38"}
{"_id": "3PeGbdqqXSZC6gk5M", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Person | some c : Class | t->c in Teaches and (some g : Group| some s : Person | c->(s->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, g : Group | some t : Person | c->s->g in Groups and t->c in Teaches and t in Teacher and s in Student 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": "tr7GfZsDysHm6TZ29", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:15:30"}
{"_id": "wdiLn4gC6q3bbYBad", "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  \n  all p : Person | p in Student\n  \n}\n\n/* There are no teachers. */\npred inv2 {\n  \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  all p : Person | p not in Teacher implies p in Student or p not in Student implies p 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": "2tKk2jApChAdcy5R9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-5 00:49:28"}
{"_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": "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": "W8zgmQhX8Godd6MiA", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | some p: Person, g : Groups, x->p->g in Groups implies p->g 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": "dpZ2AKaR3NR7a9QNJ", "msg": "There are 3 possible tokens that can appear here:\n,  : =", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:19:20"}
{"_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": "8d5uosjZpAqi4yR7s", "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  \n  all s : Person | s 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  all p : Person | ( p not in Student & p not in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ofAJYD9M9HrHCzSY2", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 19:39:00"}
{"_id": "HQCrPknreNGSnemcw", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 t: Teacher | some 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 p: Person | all s: Person | p->s in Tutors implies p 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 | some g: Group | all c: Class | 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": "srJZ5TS2dsSNGHbnk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:12:13"}
{"_id": "zZeqwnz3G6bKbPLik", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall x: Person, t: Class | x->t in Teaches implies x 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": "HWfZaFWSosvhoPL7k", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:41:33"}
{"_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": "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": "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": "hXBvNkwnCohcHmnSG", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\n  \t\t| some g : Group\n  \t\t\t| c->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\n  \t\t| c->p->g in Groups implies\n  \t\t\tsome 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\tall p1, p2 : Person\n  \t\t| 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": "uGkkAi436bL2Yu5Xe", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 20:47:43"}
{"_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": "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": "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": "KYZEyLEzbBbtSwETH", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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\tall p1, p2 : Person\n  \t\t| 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, g : Group, t : Teacher\n  \t\t| 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": "aX9jL8B9xh3qMA88k", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 21:29:40"}
{"_id": "uQTqpj3ksWna2MLCH", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p 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": "ic7drx7d4E86wbJYh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:21:13"}
{"_id": "J6m3AKhRraj9cATZj", "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\t(some t : Teacher, s : Student | t->s in Tutors implies 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": "esjrFsdEGbTfS4ydG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:34:46"}
{"_id": "mPrgJ67cD6K3f6nyc", "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 = Student\n}\n\n/* 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 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\tall x : Person | x not in Student or x 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": "civYseZNDBZGucmiX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:59:26"}
{"_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": "APr8Gg2a9yo7mwvEo", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \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  all 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  all c : Class, s : Student, g : Group | some t : Teacher | ((c->s->g in Groups) and (c->t->g in Groups)) 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": "rh4B9ktiqd5sXTeY4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:37:01"}
{"_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": "DvqHYsB6Ps9S8aBHG", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some p : Person | some t : Teacher, c : Class {\n    t->c in Teaches\n  }\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9pozYRXruCFrZ2hzi", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:42:52"}
{"_id": "2kAbDtd3ipGdWTo4E", "cmd_i": 4, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 implies (some c:Class | t->c in Teaches) implies (some g:Group |all p:Person | 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\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "dnTXu56Hv8GKfkrA2", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:39:53"}
{"_id": "68p3AsoqpoBE8BZqp", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | 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": "idQ65phKoGCmZrqiH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 15:13:46"}
{"_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": "iFZQ2BfipB8ZiseJG", "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  \n  all s : Person | s 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  no (Student & Teacher) \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t(no Student) and (no 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": "CLxZCDWsofEwdHXMS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 19:48:42"}
{"_id": "T5XkeHoaRsuHoXbRR", "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, 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 x : Class, s : Student | some g : Group | x->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": "NZkLsLZi7nXJRtHPv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:10:57"}
{"_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": "GvZBFnMHAva2oiKYb", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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(some p1, p2, p3 : Person | p1 != p2 and p2 != p3 and p3 != p1)\n}", "derivationOf": "F7Lbe6KHonqsqjH44", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:54:02"}
{"_id": "2C2m8AtvMH8brGMdj", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\t\n  \t(all c : Class | some p : Teacher | p -> c in Teaches and p in Teacher) implies \n\t\t(all g : Group, c : Class, p : Person | c -> p -> g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "WPSgWxWLFTL4fMB5q", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 03:14:36"}
{"_id": "ABgEEGZnmKwzp5vnL", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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  some c:Class ,g:Groups ,t:Teacher| all s :Student | 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\n}", "derivationOf": "2xtQApoGfLYW9QL9Q", "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-10-27 14:12:56"}
{"_id": "yivbrEKMoXx6PQA4s", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "APtC8BgKyyLNStwrn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:31:42"}
{"_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": "tdxL6PgziXo7NfAoE", "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\t(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\t(all 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\t(all 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\t(all s:Student, g:Group, c:Class | some t:Teacher | 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": "LPaxDGH3yptN3rtKL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:51:57"}
{"_id": "AjabSK7FqggGWue8y", "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\tTeacher not in iden\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "y77XA2wPNz8jRF8J6", "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": "2020-6-14 22:44:40"}
{"_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": "QRfrzocFPfRmmgx5Q", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | some g: Group | t->c in Teaches implies c->t->g in Groups[t]\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TsfKB5kWbga85oFSF", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {none->none}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:20:54"}
{"_id": "rFtehFZjCSsWXGjwD", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> 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/* 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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x 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": "TMCbQRzB9492XjBq7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:32:49"}
{"_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": "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": "6ig5dwepe2C5xasmF", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | all s:Student | some g:Group | c->(s->g) in Teaches\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3fEqaErL4GJAH3uWw", "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": "2020-10-29 09:51:02"}
{"_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": "9Rsyrm9QYauaXn7Zr", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, 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\tall t: Teacher | some c: Class, g: Group, p : Person | c->p->g in Groups and t -> c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall a, b : Person | a -> b in Tutors implies a in Teacher and b in 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 : Person, c : Class, g : Group, t : Person | 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": "pfQZBoaqGfWanTAAE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:29:33"}
{"_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": "C5AWDGFdm7MbKKath", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\t\n  \t(all c : Class | some p : Person | p -> c in Teaches and p in Teacher) implies \n\t\t(some g : Group, c : Class, p : Person | c -> p -> g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "6chnDWH47JTJwqizM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 03:13:24"}
{"_id": "kjGTQMRFSimhDXxba", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 | \n  \t\tc -> t -> 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": "xxiHCtg32JeHECrqS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:40:43"}
{"_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": "G5GaC8Z8QDaxuTPbk", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "JKfkDb8yLoiMxwJfj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:36:29"}
{"_id": "bEy7ckvqnd8GYeocF", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some 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": "uqkSJ4xG4dAXuMowE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2021-1-12 00:59:00"}
{"_id": "YzfX3gt4jq5dCk49T", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 c:Class | some t:Teacher | s->t 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": "CqqaebSH26xvTeAw3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:06:04"}
{"_id": "pZMLmZbXAFLCdZ5cN", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rZSL8X2zrQ2nMMK3T", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:46:41"}
{"_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": "TsfKB5kWbga85oFSF", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | some 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 p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jsNFr2osxR4xmz5Ck", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:20:41"}
{"_id": "x2CtD4rJLSRbMwDqd", "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, 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 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\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 p1, p2 : Person, c : Class | (some g : Group | c->p1->g in Groups) implies p2->c in Teaches implies p2->p1 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": "5hcyiLeudDo8Hdvsh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:47:10"}
{"_id": "wqBNWHamTojLuCcMq", "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  \n  all s : Person | s 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  all p : Person | p not in (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": "wuEENfXhe4m53R4JG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 19:40:31"}
{"_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": "TXJTzqcyWozP8NYQi", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tsome s :Student | some c:Class | some g:Group | c->s->g in Groups and (some t:Teacher| t->c in Teaches implies t->s in Tutors)\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "dw3zC9zSfiK5dbisP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:05:17"}
{"_id": "jTJ7xb3XZhs5YwJZn", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c:Class, t:Teacher | some g:Group | c->g in 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\n}", "derivationOf": "8NbX6ktBiBKgobsZ5", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Group}\nRight type = {this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 16:04:11"}
{"_id": "eSoPbXiL9Pkf5YAo5", "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/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9999ANsBRvpvFSzAT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:25:35"}
{"_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": "eurXTgXcFtxvdEyat", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n\n  \n  all p1,p2,p3:Person | p1\n}", "derivationOf": "PG9zTj78aBDpdsLG3", "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": {"Person0": {"x": 402.66666666666663, "y": 199}, "Person1": {"x": 805.3333333333334, "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/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": "2020-10-27 15:00:17"}
{"_id": "Sx7MTeZku3cRBXhzn", "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\tfor 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": "ATD9iFMZu2dmdMeYR", "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-11-5 00:38:32"}
{"_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": "krw38XvsCyR4MHDDf", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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\tall p1, p2 : Person\n  \t\t| p1->p2 in Tutors implies p1 in Teacher and p2 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": "MuhfXkZPeCtgFah8c", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 21:15:32"}
{"_id": "NByyZREGdLEHt54up", "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  all Student in Person \n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\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 \"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": "2020-11-5 00:34:09"}
{"_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": "5uRayQXmKqtLQTyuX", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all 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  all t : Teacher | some p : Person, c : Class, 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YB8rp2nnhamzsf8Mr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:10:21"}
{"_id": "kpH23aHEojCfo3c4P", "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\t(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\t(all 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\t(all 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\tsome s:Student, g:Group, c:Class | some t:Teacher | 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": "dko29vX3AeiPBJR5B", "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-10-29 10:00:10"}
{"_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": "jG5hYYDBERzucawC2", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall t:Teacher |some c:Class | t->c in Teaches\n\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": "2R2NrFk8cwda97mKH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 11:53:59"}
{"_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": "EH89o3uWEJh5rSbhy", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "mwivkEPgbseCBA7bm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:09:11"}
{"_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": "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": "2BRLfeMLJKgThEuJS", "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  \n  all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n  \n  no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n  \tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \n  all p : Person | p in (Student + Teacher)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n  some c : Class ,t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n  all t : Teacher | (#t.Teaches)>0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xg2eQoZW4rx7RTFLA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:57:24"}
{"_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": "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": "feuL3vvZkoKTjLuKM", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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": "Gei6du7dqFD8qnvkJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 21:04:09"}
{"_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": "vQQ3smqapTTXCE3Ew", "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  all p : Person | p in Student\n  \n}\n\n/* There are no teachers. */\npred inv2 {\n  \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  all p : Person | p in Teacher implies p not in Student or 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  all p : Person | p in Student or p in Teacher\n\n  \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": "2PsJW7GpZZwGfSkoM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-5 01:04:44"}
{"_id": "kRydxXYRvgAyhjMWc", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class| t->c in Teaches implies (some g:Group |some p:Person | 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\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "WGs5PjbjKyLsKk2NL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:25:23"}
{"_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": "f2RiLBK7TjhYrqDR7", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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 | all p : Person  c -> p -> g in Groups implies p \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "D4Q4BQFzB2LqARus2", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 02:07:24"}
{"_id": "m2YM3nbJsL9BMdGLe", "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 | 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 | 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,t2:Teacher | all 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  \t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n  \tall t:Teacher | some c:Class,g:Group, s:Student | ( t->c in Teaches) implies (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\tall s:Student,c:Class,g:Group | some t:Teacher | (t->s in Tutors) implies ( (t->c in Teaches) 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": "JT35gDAcWvMM5EMgh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-4 22:31:02"}
{"_id": "sL7G752PcbofW2W8p", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 (Person-Student-Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t:Teacher | some t.Teaches\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some( c.~Teaches & Teacher) \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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": "HGnBHFaZRNA3req6Z", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2021-1-13 18:23:32"}
{"_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": "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": "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": "knxhQneaREJaAjnZ9", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student,t:Teacher |(some g:Group | c->s->g in Groups) | t->c in Teaches implies t->s in Tutors\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": "4GHpMMqKQoMi9RhTg", "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-10-29 10:16:01"}
{"_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": "s5sptA7qCp7eykicC", "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 Person in 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": "Yf4p6uqi8BmRzAJ2m", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-22 10:27:59"}
{"_id": "5S4vnBst8qKGzH8qa", "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\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tno (Student & Teacher)\n\t\n  \t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  no Student and no Teacher and no Class\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hAQritWh3uaD8vWBy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 20:11:20"}
{"_id": "DRf6v4Ne3b8QPBATd", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 | all c:Class | (some t:Teacher | 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\t\n}", "derivationOf": "7GCdHyM7Eqj7irwxt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:31:47"}
{"_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": "gLJpYcLFr555iPTri", "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\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 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 | all 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": "TdNmJSYiMvG7HR2GG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:16:53"}
{"_id": "pFKpMrFFEjnoXuew4", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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  lone t: Teacher | some g: Group | some c: Class | c->t->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": "hfoEuFh5ew2cbSA6S", "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-10-29 09:48:59"}
{"_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": "wG5EJWmqPfYK9nGst", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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  lone t: Teacher | some g: Group | some c: Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t: Teacher | all s: Student | t->s in Tutors and not s->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": "McF7YMmwhRzdEiPyu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:52:01"}
{"_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": "YxRr3XR62P6Md3wpD", "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 f : Person | f in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall f : Person | f not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall f : Person | f 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\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3SinRe9qGFN2TTweu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:17:15"}
{"_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": "XE5FLbKYFLWGPd6Rz", "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  Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall t:Teacher | t.Teaches in iden\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno t:Teacher | t 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": "XWFdXMQMxdCjFKPS2", "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": "2020-6-14 22:52:09"}
{"_id": "TSLAc4yn4LS9KMrfa", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, g:Groups | some t:Teacher | g in c.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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "h76codmLt5Simr3vd", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 15:06:22"}
{"_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": "zWwJuSS2fdpiGLtaL", "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 all 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 Teacher and p not in Student)or(p not in Teacher and p in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dtdmsNHvNyuaPgHna", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 17:49:27"}
{"_id": "YfRxYfHwnnfeKvAKJ", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | all t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\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\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 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/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "b8QdaqThJCYvQj8EZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-12 01:08:22"}
{"_id": "PerRraCTvhKc87b5s", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, 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": "ps7JvtzRT9hHG6XvP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:59:39"}
{"_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": "AQruDZmAAjDf5MTsY", "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 | 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 | 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,t2:Teacher | all 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 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\t\n   all t:Teacher | some c:Class | some 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": "7TYSDPnXqtud3bjku", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:26:50"}
{"_id": "D638S8ca9AjMEpt6e", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher, x : Class | t->x 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    all x : Class, s : Student | (some g : Group | x-\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "fTvJXbvmAt5dmooKR", "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": "2020-10-29 09:45:13"}
{"_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": "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": "ZAiXmSFpwwBSMZr9Y", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t: Teacher | t.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": "KhrDxb2v4CwRXT3nk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 15:12:36"}
{"_id": "iPWb3hdP5hhA4Z67W", "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\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 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 | all 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": "FZ3ufMrA73926sdwM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:20:49"}
{"_id": "99tGfP9cmrTqrezRz", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student | some t:Teacher, g:Group | s->g in c.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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7YH9ebh5ZzcdjxyRq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 15:02:32"}
{"_id": "huwYeSQ35arn7jXrM", "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 {\nno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nnot (some p : Person | p in Student and p 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 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": "GHnc9AEqABPoceuiK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 21:43:02"}
{"_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": "FqyxSWm4vzyJnvsWb", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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": "Qgc3jDnJpdZgCr52w", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 21:37:51"}
{"_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": "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": "ppGDJxTi249eDKvoW", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  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\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "e4TBxrZ8mSAc9H6QW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:29: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": "moJ8fPGHGeooi7pkw", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (some t : Teacher | t->c in Teaches )\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \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 p1, p2 : Person\n  \t\t| 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\tall p1 : Person | (p1 in Teacher) or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher) or\n\t\t\tsome p3 : Person | (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher))\n  \t\t\t\n}", "derivationOf": "i8AKLq5G69bvtjkT5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:10:24"}
{"_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": "SkLhQeLn5BG7PM3Wa", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, 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\tall t: Teacher | some c: Class, g: Group, 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\tall p,pp: Person | p->pp in Tutors implies p in Teacher and pp in 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 implies 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": "6gE6ZajNEiQu863Fm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:23:21"}
{"_id": "bFjzf2tySJqr75Dr7", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t, p : Person | (c->p->g in Groups) implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */ \npred inv12 {\n  all t : Teacher, c : Class | some g : Group, p : Person | p in Group implies t->c in Teaches\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "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": "2020-11-18 17:33:53"}
{"_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": "xyEMEPeChSLrFPj5M", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher | all c : Class | all d : Class | x->c in Teaches and c!=d implies x->d not in Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tsome t : Teacher | all c : Class | 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": "qXPBn9X7inXZfP5dv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:31:09"}
{"_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": "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": "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": "o7eucWJGa6AftMky6", "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 p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group | some p : Person | c->p->g in Groups implies (p->c in Teaches and p in Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all s : Student, c : Class | some t : Teacher | 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": "Q2jRb72tr23Mi2vhD", "msg": "The name \"g\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:37:52"}
{"_id": "rpxSmbaEcum7RnKxB", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, 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\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/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6JveuYuzsAHaPAQnq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:32:07"}
{"_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": "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": "oYjhL4hBmbZAHe3h4", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | some g: Group | some p: Student |  t->c in Teaches implies c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bew39TczGLWwLNBuA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:28:25"}
{"_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": "Qrk3bCgNfYSm8wuJZ", "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": "kb9R6bqLppTBZTCSu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-9-30 10:04:04"}
{"_id": "xYoqCtSsRysTrZGpR", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n \tall s :Person, c:Class | (some g:Group | c->s->g in Groups) implies  (all t:Person| t->c in Teaches implies t->s in Tutors)\n  \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "g56oLAaxhEcEEHqWN", "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": 314.26666259765625, "y": 199.1999969482422}, "Class1": {"x": 628.5333251953125, "y": 199.1999969482422}, "Group0": {"x": 314.26666259765625, "y": 99.5999984741211}, "Group1": {"x": 471.3999938964844, "y": 298.7999954223633}, "Person": {"x": 628.5333251953125, "y": 99.5999984741211}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "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": "2020-10-29 10:40:09"}
{"_id": "CLxZCDWsofEwdHXMS", "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  \n  all s : Person | s 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  no (Student & Teacher) \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Student) and no( 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": "TbXPe2YbPj34y8Y3S", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 19:48:23"}
{"_id": "W54Fq2vtNK4Z3GqAy", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall 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": "5KQbhvBLsWezomFXC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:29:15"}
{"_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": "apG44CXnNjqdDLTmZ", "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  \n  all s : Person | s 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  no (Student & Teacher) \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p not in Student\tand p not in Teacher implies  no (Student + Teacher)\n \n  \n  \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7KSTCELwEMCrKctB9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 19:54:45"}
{"_id": "dnqJd2j874HmugM9u", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Teacher | p.Tutors in Student and p.Teaches in Class.Groups[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": "sXMwLAFALYMmefsk8", "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": "2020-10-27 15:16:41"}
{"_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": "Cf9jRLtyqNc9PZfm4", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rG9fCwFFkttzQzCBb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:45:13"}
{"_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": "x5LYTLHS6WxaTcsCK", "cmd_i": 13, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tsome s :Student | some c:class | some g:Group| c->s->g in Groups and (some t:Teacher t->c)\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "47SwHqmybGduidnK2", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:52:55"}
{"_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": "AA2vRQWasJ4LvR5rC", "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": "ZRjczWqfATgCzoEHg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 11:17:38"}
{"_id": "w3ZC5zz9T8Rh3cXTh", "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  some p: Person | p in p.teaches\n}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "i3n3bZYAqPfYbNKEX", "msg": "There are 1 possible tokens that can appear here:\n}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:01:01"}
{"_id": "EPEzyTedWsQdphhE5", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\t\n  \tsome p : Person, c : Class | p -> c in Teaches and or  or \n  \t\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n  \tall p1 : Teacher , p2 : Student | 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  \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": "9S29LBjyuFszcjvpY", "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": "2020-10-28 03:45:45"}
{"_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": "MK3S3EHgJNuNQfBZg", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some g:Group |some 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\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | 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": "X3pDdABCkemPsjxCj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:21:46"}
{"_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": "5sQw2doWLsNpoZatW", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\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 | 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 | 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,t2:Teacher | all 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  \tall c:Class, s:Person, 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\t\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\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": "SkazxpidzgPdmGN6x", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-4 21:12:29"}
{"_id": "ymwT8GZ4J8qzpGMuQ", "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 = Student\n}\n\n/* 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": "6edJQpxjLn6bKwA23", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:54:36"}
{"_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": "ps7JvtzRT9hHG6XvP", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, g: Group | t->c in Teaches implies 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\n}", "derivationOf": "hod9fE4gnjiaXpagv", "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": "2020-10-29 09:59:29"}
{"_id": "fvNY2YTP6qxpqSkLz", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 | (some c : Class, g : Group | \n  \t\tc -> t -> 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": "m27RQnnr8YYhB9PRd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:42:30"}
{"_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": "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": "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": "EuueiHypv4wm7zBZh", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some g:Group,t1,t2:Teacher | (c->s->g in Groups and t1->c in Teaches and t2->c in Teaches) implies (t1->s in Tutors and t2->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": "epLkf3Xqw4HZqvWaA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:23:48"}
{"_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": "cGrdT7xffuqAXBxFq", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall 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 Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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\tall c : Class, p : Person, g : Group\n  \t\t| 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": "fZ2F4uPN7vvfJaimu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 20:04:05"}
{"_id": "yibw5gcHp5Y9czWLM", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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  all t:Teacher | all c1,c2 :Class |t->c1 in Teaches implies t->c2 not in 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": "ndxRLs9ZQ47MABt6N", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 12:09:28"}
{"_id": "qD43WjsT7yazjJevp", "cmd_i": 13, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tsome s :Student | some c:class | some g:Group  c->s->g in Groups \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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "DHyhB6uKsFQsCwPFC", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:54:40"}
{"_id": "pY9GAA5C6XeXivEso", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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": "4rPoCeGBagbJo7sJs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:50:33"}
{"_id": "F3gMC7PunZbJqokwa", "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\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": "qsaogfXKwk6Nk8GKP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:58:47"}
{"_id": "Y2yetiL6D8FuRoWSG", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group | some p : Person | c->p->g in Groups implies (p->c in Teaches and p in Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all s : Student, c : Class | some t : Teacher | c->s 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": "5DYPsTq8ByJbbx8Xf", "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-10-29 09:37:34"}
{"_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": "Lzt3LfMjNwKAPGRPD", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\tall c : Class, p, p1 : Person, g : Group | (p -> c not in Teaches or p not in Teacher) implies c -> p1 -> g not in Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "Hz2cYphZiSWxKZSRA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 02:46:22"}
{"_id": "ZWgoSKyuwSYEbHu2e", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some t:Teacher,g:Group,p:Person | c->p->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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zPHzq7e8SpjPETwSA", "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-10-27 15:13:31"}
{"_id": "A37ip2KdW7xpdcKYD", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | all t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\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\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 Class->t->Group in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4445ebzG47A8ggFNi", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2021-1-12 01:05:42"}
{"_id": "p3hJuKvQ3SpwKDZHa", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  implies (some t:Teacher | t->c in Teaches )\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tsome t: Teacher |some c:Class | t->c in Teaches implies (some g:Group |all p:Person | 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\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "yHnipcdwdA8zb6Fvg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:34:10"}
{"_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": "5jtdkLmcagasv97Gd", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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 p1, p2, p3 : Person\n  \t\t| p1 in Teacher or\n  \t\t( p2 in Teacher and p2->p1 in Tutors) or\n  \t\t( p3 in Teacher and p3->p2 in Tutors and p2->p1 in Tutors)\n}", "derivationOf": "iEJjTMw94DGseiW3S", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:37:32"}
{"_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": "dyFqhheuJxBWS8yda", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some g:Group |some 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\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n\tall s:Student,t:Teacher | some g:Group,c:Class | 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": "MK3S3EHgJNuNQfBZg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:27:29"}
{"_id": "LoKxZWkyD9Zb2Eep7", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, g : Group, p : Person, 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\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\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uqciWzmQoCSLNKEjy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:08:37"}
{"_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": "4XgFFMf64pkRJHWFQ", "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  all p : Person | p in Student\n  \n}\n\n/* There are no teachers. */\npred inv2 {\n  \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  all p : Person | p not in Teacher and p not in Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "e6GCMK39LbCPELHeQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-5 00:48:08"}
{"_id": "vZ5vZAcMXzFJRpbFp", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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\tall p1, p2 : Person\n  \t\t| 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": "krw38XvsCyR4MHDDf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 21:15:46"}
{"_id": "dpZ2AKaR3NR7a9QNJ", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | some p: Person, g : Groups, x->p->g in Class implies p->g 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": "2LB4NjdxF9gAv5rHz", "msg": "There are 3 possible tokens that can appear here:\n,  : =", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:18:39"}
{"_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": "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": "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": "tJ5pKYiwxdSyAArMF", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t, p : Person | (c->p->g in Groups and c->t->g in Groups) implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9q2sStMrykYqKaXyy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:19:43"}
{"_id": "GWxF99Yb4We8mr3CE", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | (some g:Group | c->s->g in Groups) implies (all t:Teacher | t->c in Teaches and 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": "7pM3XM8iHhrRztzei", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:26:24"}
{"_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": "arBpNRas6KaSr8ycy", "cmd_i": 10, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g)  implies (some t:Teacher | t->c in Teaches )\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  all 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\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 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "dgrj2ZCj2Q3D284FS", "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-10-29 09:17:18"}
{"_id": "AQWswx3NZybmfsTfs", "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": "KaGDkKvshRgbztqiC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-9-30 10:02:31"}
{"_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": "BpJp9WQfimvbpT5iq", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x not in Teacher\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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all 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": "9AMB9BAjJ4rTu4yZj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:10:00"}
{"_id": "wsvqCCjn3tGxtkhnZ", "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 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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  all t:Teacher | all c1,c2 :Class |t->c1 in Teaches implies t->c2 not in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2: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": "FvFS2onx6yBTQEBH3", "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": "2020-10-27 12:09:03"}
{"_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": "aBhTGkrncdA34ssok", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some c.Groups) implies (some (Teacher & c.~Teaches))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some (t.Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n  all p : Person {\n  \t(some (p.(~Tutors) & Teacher)) or\n  \t(some (p.(~Tutors).(~Tutors) & Teacher)) or\n\t(some (p.(~Tutors).(~Tutors).(~Tutors) & Teacher))\n  }\n}", "derivationOf": "RixgDrJLMQJEFRBuz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:11:40"}
{"_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": "WACbEQ7XmB42mmWnM", "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, 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 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\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 p : Person, c : Class | (some g : Group | c->p->g in Groups) implies\n  (all t : Teacher | t->c in Teaches implies 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": "Zw99mDLEs3F3SEdAT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:38:14"}
{"_id": "GfeGbEyWmZw7rqyrx", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group | some t : Teacher | c->t->g in Groups and t->g in Teaches\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  all 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\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\n}", "derivationOf": "2GzMeioEAs7QCvQuA", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:05:26"}
{"_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": "na2SbwgDJGP549pNk", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t, p : Person | (c->p->g in Groups and c->t->g in Groups) implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */ \npred inv12 {\n  all t : Teacher | some g : Group | t->g in Teaches\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mGfR8XmYDBcqhuN9k", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:21:21"}
{"_id": "QnwrntCAdbvoXXqgq", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 | all  g : Group | \n  \t\t(c -> t -> g in Groups and t -> c in Teaches) and 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": "wNFcsx8xWq7F6PLzX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:44:19"}
{"_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": "Nc3DdEGhK2XdqnwvR", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some g:Group |some 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\t\n  \tall t:Teacher | some c:Class,g:Group | c->t->g in Groups implies t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n\tall s:Student,t:Teacher | some g:Group,c:Class | 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": "ScaqCdcPiXNhDWTyj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:35:34"}
{"_id": "yv5dYFk68aW9yfSNZ", "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, 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 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\tall t : Teacher, s : Student | t->c 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": "jzMgZrqjcQwDf987n", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:20:47"}
{"_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": "trJ3tDRf3epMQFNG7", "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\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": "FoeQyeM2jQ87R8dG9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:59:47"}
{"_id": "idQ65phKoGCmZrqiH", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | p in Teacher and p.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": "ZAiXmSFpwwBSMZr9Y", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 15:13:39"}
{"_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": "36Jyf6p7sv7Lb76vy", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n  all x : Class | (all t : Teacher | t->x in Teaches) implies (all p : Person, g : Group | x -> p -> g in Groups)\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "RzQzJj43WCg5rXTzN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:09:37"}
{"_id": "JASAepyW9eg8TyDAm", "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": "PQoQJT9BYcoKQJ4D3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-9-30 09:57:45"}
{"_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": "3Tv9LmDgCXnqwZdMh", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher | all c : Class | all d : Class | x->c in Teaches and c!=d implies x->d not in Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all 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": "SgNw4hMJv7XJmWK5L", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:29:17"}
{"_id": "xnj8tbw9AyAhtbut8", "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 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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Teacher and x not in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  all t : Teacher, some c : Class | t->c in Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher, some c : Class | t->c in Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all x : Class | some p : Person, g : Group . x->p->g in Group implies some t : Teacher | t->x 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": "wS5g2vaPSzxmPJCP2", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:48:08"}
{"_id": "RzR4BivBGLZHt54D9", "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/* 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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, 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 Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KJWfqgKFgkuudhrZn", "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-10-28 18:44:56"}
{"_id": "rKzNR5gwTxXjhAtdv", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\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/* 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": "y8JYpMCa5CRcEMP4u", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 01:52:15"}
{"_id": "k5xDAKk6W2te5GmMG", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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 p1, p2, p3 : Person \n  \t\t| (p1 != p2 and p2 != p3 and p3 != p1) implies\n  \t\t  ( (p2->p1 in Tutors and p2 in Teacher) and\n            (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher))\n \n}", "derivationOf": "E33meyDRBAnb8ivWh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:57:14"}
{"_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": "zk4RWeepwumWd8LFY", "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\t(all s : Student | some g : Group | 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": "qsWhWAjDNmWCHCH8L", "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": "2020-10-28 22:59:10"}
{"_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": "9BxQcpEJ6kHQMZjrs", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 c:Class | some c.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aq2NQWoNABvAbCQgH", "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": "2021-1-12 00:55:00"}
{"_id": "jDoEFD4id9keRuqcc", "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\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall 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 Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s,t:Person | all c:Class | 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\tall t,s1,s2:Person | all c:Class | all g:Group | (c->(s1->g) in Groups and c->(s2->g) in Groups and t->c in Teaches) implies (t->s1 in Tutors and t->s2 in Tutors)\n}", "derivationOf": "G48cByTGakEGabQDi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:40:30"}
{"_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": "jaLKJ4r3CWX7LmrMd", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n  all ps : Person, t :  Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9GoZNixvEDdXBx6g6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 11:41:28"}
{"_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": "LjgbWQ7Wi3X5Qm6za", "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} th\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\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 | 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 | 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,t2:Teacher | all 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  \tall c:Class, p:Person, 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\t\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\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": "duWu9iZ9yD77j2Lzt", "msg": "There are 5 possible tokens that can appear here:\nenum fun let open pred", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-11-4 21:08:02"}
{"_id": "z2jLtRGRAfts5dMuq", "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 all 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 Teacher and p not in Student)or(p not in Teacher and p in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "T7poFHwm83cTSJY22", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 18:25:16"}
{"_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": "yCoAFtnwhhkK4dj2y", "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": "2020-10-29 09:09:28"}
{"_id": "rFujq7pHqN4Crfy9b", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent 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": "be3B4RCydLexQwAnN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:55:07"}
{"_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": "iY6dNPzPHjjdzdDcX", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some c.Groups) implies (some (Teacher & c.~Teaches))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some (t.Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n  all p : Person {\n  \t(some (p.(~Tutors) & Teacher)) or\n  \t(some (p.(~Tutors).(~Tutors) & Teacher)) or\n\t(some (p.(~Tutors).(~Tutors).(~Tutors) & Teacher))\n  }\n}", "derivationOf": "zm9pRdeTShQL9kakQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:11:22"}
{"_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": "2ZWZHgWbnnQ5cZxHW", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, g : Group | some c : Class, t : Teacher | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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\tall p : Person | some p1 : Person | p -> p1 in Tutors implies p1 in Teacher\n}", "derivationOf": "pnYtm6HknLttigznf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 00:10:01"}
{"_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": "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": "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": "ndR6Y5Asoqmcxf9gw", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WYeqyR9PJQx2xXsYy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:03:47"}
{"_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": "Z9mKHYxGA2a2PSEmH", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | some p: Person, g : Groups, x->p->g in Class implies p->g 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": "Mwt9NT4aiN4Pce3Gn", "msg": "There are 3 possible tokens that can appear here:\n,  : =", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:17:21"}
{"_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": "9LXWwqk6sbPCmp5K6", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \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  all 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 c : Class , s : Student , t : Teacher | some g : Group | \n    ((c->s->g in Groups)and(c->t->g in Groups)) 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": "FHe97KrMyRujJutSD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:46:08"}
{"_id": "6agLZvTb43btaJLt9", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher | all c : Class | x->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": "8euoFSiicCrJtynXS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:22:54"}
{"_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": "sdNseyFvgzNBtWPqN", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher, c:Class | some g:Group, s:Student| t->c in Teaches implies s->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\n}", "derivationOf": "AL2XnhHQfhsoBsNoh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 14:43:01"}
{"_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": "iJGot4cpStSH9XQ5X", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | all 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": "42oRffQ6y9EZwuo7W", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:55:56"}
{"_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": "KZY3hy6EzyPXrKwoC", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\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\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mNs9T7Lb2Pa5TZyoK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 21:26:46"}
{"_id": "r8wM9yvQQwHc86Wkm", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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 | (some g : Group | c->s->g in Groups) implies (all t : Teacher | 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": "yPzBdS4titjb5KxAA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:35:42"}
{"_id": "eTWyThDcyPpCbrW2y", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches | c.Groups in t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone c: 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": "9Zr36nBekJGbCYLaj", "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-10-27 14:42:27"}
{"_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": "QKDhkAWFRj8fDj7he", "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": "jd7647kXTGBqJb3Dw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-9-30 10:01:10"}
{"_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": "CDidD6mhrTvFPJzNJ", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* 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": "w3ZC5zz9T8Rh3cXTh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 14:02:57"}
{"_id": "u6ZR3mrZrXFdusHZK", "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 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nnot (some p : Person | p in Student and p 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 Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall 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": "huwYeSQ35arn7jXrM", "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": "2021-1-13 21:43:32"}
{"_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": "EcW7HDqhfLxQJxrRM", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c : Class | lone t->c in Teaches\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wERiE9imcKaWnxMzm", "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-11-5 08:59:38"}
{"_id": "dTQtxvhD2djaD5Doy", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \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  some p1,p2 : Person | (p1->p2 in Tutors) implies p2 in Teacher and p1 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": "pkAwdd5njCXG3KJoe", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:29:28"}
{"_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": "Rw9SX4vxik5boa9i3", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 (Person-Student-Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t:Teacher | some t.Teaches\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some( c.~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": "ogWdTx9ttbEyCw5en", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:49:44"}
{"_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": "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": "d3epFCcgGYi3kHqaz", "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\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "Cwx2DB6CgvEHFW7BM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:32:30"}
{"_id": "WL5vauD7TK7DQmp5M", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t, p : Person | (c->p->g in Groups and c->t->g in Groups) implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */ \npred inv12 {\n  all t : Teacher, c : Class | some g : Group | t->c in Teaches\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SCXcstLzQdHZKkFKk", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:22:36"}
{"_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": "9vbeLhkHAQxFucnra", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t: Teacher| some x:Class | t->x in Teaches implies some g:Group | x->t->g in Groups \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\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": "vPTGaDzh8mdJfQB9P", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-5 11:35:10"}
{"_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": "XxRLmaWScmXQjGbgH", "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 p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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, g : Group | c->s->g in Groups and (some t . Person | t->c in Teaches and t in Teacher 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": "KCGDB69ajbzYkPZbE", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:30:42"}
{"_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": "47SwHqmybGduidnK2", "cmd_i": 13, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tsome s :Student | some c:class | some g:Group c->s->g in Groups and (some t:Teacher t->c)\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "B7ZEQa8RPif528qQw", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:52:47"}
{"_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": "z2uBxRohcAMHpQpwd", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 | some t.Teaches in c.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": "5fYG6jxpWdrx9BqhR", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:28:45"}
{"_id": "pHRodQLXwhc5MSzzp", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\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/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KBo9bu4A5AmAHCcDB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 22:56:17"}
{"_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": "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": "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": "NNtjFRcZtYFLYKueg", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, 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\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/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uZofRLfs5TAjm5qD7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:44:04"}
{"_id": "Gr25LBSiiLJSdrGLn", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some c.Groups) implies (some (Teacher & c.~Teaches))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some (t.Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n  all p : Person {\n  \t(some (p.(~Tutors) & Teacher)) or\n  \t(some (p.(~Tutors).(~Tutors) & Teacher)) or\n\t(some (p.(~Tutors).(~Tutors).(~Tutors) & Teacher))\n  }\n}", "derivationOf": "wrcyFK7EqvqQKg5ay", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:11:33"}
{"_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": "ZS8G2HBXcKj4ckZan", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 |all c:Class | t->c in Teaches implies (some g:Group |all p:Person | 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\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "7r52hbuoCcdgSNKve", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:25:45"}
{"_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": "zegf4a33j6wxACAKi", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t(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\t(all c : Class | some s : Student | some 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\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}", "derivationOf": "jocaGDaCYr4YGfFpf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:13:43"}
{"_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": "3QMzoSGryARLh8Qm2", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher,c:Class | some g:Group | t->g in c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "icyCwb4QSXStYHWXu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:09:33"}
{"_id": "sA7JpwrSnGDqq9Y5S", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 c:Class | some t:Teacher | t->s in Tutors 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\n}", "derivationOf": "MBnNyqZAwQZetJ7Me", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:11:47"}
{"_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": "aK6RknGHpyRmqoqYx", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t, p : Person | (c->p->g in Groups) implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */ \npred inv12 {\n  all t : Teacher, c : Class | some g : Group, p : Person | p in Group implies t->c in Teaches\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Y3BMDq2q4WokJNE6n", "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": "2020-11-18 17:34:02"}
{"_id": "MbZa9FNbB4xCudeqM", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 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": "L5FcJu2oaphRWjR7e", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:09:26"}
{"_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": "obRiiKF27ofmm7FEj", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall x : Person | all c : Class | one x->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": "C3SJpjMoseYPHJTCY", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:14:25"}
{"_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": "479kFoDmmX9HHPirw", "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 {\nno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nnot (some p : Person | p in Student and p 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 Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall 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": "nNNwqXpi8qNzZFhMq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 21:48:49"}
{"_id": "DvQ4BRz2xjGdosb5R", "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/* 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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all g : Groups | some t : Teacher | 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": "BcCvQk4JiMeGZrjPr", "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-10-28 19:00:01"}
{"_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": "KPTwoFqQDz4jeKvY8", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "JQx9DbXjuLvA7Kf9h", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:37:32"}
{"_id": "5c7ZQZbs8iFrAWRPC", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\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": "hKbDLvBhmSxv5isay", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 15:13:07"}
{"_id": "WYeqyR9PJQx2xXsYy", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZLzrHQYsAWat9Yne3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:03:44"}
{"_id": "Wq9Au27ys6iRip6CD", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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 | all t: Teacher | some g: Group | some c: Class | 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": "MR2a3dHWygKsr7BiZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:08:43"}
{"_id": "GRSuLtEunFAkAWM97", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 p1, p2 : Person, c : Class | ((some g : Group | c -> p2 -> g in Groups) and \n\t\tp1 -> c in Teaches) implies p1 -> p2 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": "SPW9wmfq4m2TdEdDd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:25:04"}
{"_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": "FHzNzFWvtsNSacvX9", "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/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t, p : Person | (c->p->g in Groups and c->t->g in Groups) implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */ \npred inv12 {\n  all t : Teacher, c : Class | some g : Group | c->t->g in Teaches\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "na2SbwgDJGP549pNk", "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": "2020-10-29 10:21:50"}
{"_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": "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": "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": "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": "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": "kb9R6bqLppTBZTCSu", "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\tPerson = 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": "rp9gWyhTSjm7MJbCv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-9-30 10:03:42"}
{"_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": "i2bWcWakQCqLeaWrf", "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 Teacher implies p not in Student) and (p in Student implies p not in 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\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": "wJPszkuiHqi8xvcWd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 13:44:22"}
{"_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": "sbv3YSwqmS4Ws4vj4", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PkZxDRFGxi9Firvtb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 12:20:24"}
{"_id": "i25dK2k45MaucWifT", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 g : Group  c -> s -> g in Groups)  and (some t : Teacher | 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": "t4aPjK3AMfgXLGKDX", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:19:41"}
{"_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": "n3m2wvjrTX8Trd9FB", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "36ReDhWJWNKDhJD3f", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:14:59"}
{"_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": "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": "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": "mDRTPFgM82EfevjCg", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall x : Person, c : Class | x->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": "DoNwbZT2YaPXMCd4Q", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:13:01"}
{"_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": "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": "yqxzCoKfPtb5QuAeE", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all 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  all t : Teacher | some p : Person, c : Class, 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 p : Person | some t : Teacher, c : Class, g : Group | t->p in Tutors implies t->c in Teaches and c->p->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": "JJzgTgx6jpQzHDbc2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:28:07"}
{"_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": "xRanWHSMGq6harM2T", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \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  all 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 c : Class , s : Student , t : Teacher | some g : Group | \n    ((c->s->g in Groups)and(c->t 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": "9LXWwqk6sbPCmp5K6", "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": "2020-10-29 09:48:02"}
{"_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": "9JPBafj82rqSuGzow", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all 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  all t : Teacher | some p : Person, c : Class, 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 p : Person | some t : Teacher, c : Class, g : Group | t->p in Tutors implies t->c in Teaches and c->p->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": "yqxzCoKfPtb5QuAeE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:28:13"}
{"_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": "xjARmJdg3s8itd8NK", "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": "dSBtTL7em4y6FpebX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 08:57:17"}
{"_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": "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": "3aY7ZzYZoFt9QrT7C", "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 => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some t->Group 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": "WqFyxKqHnKAQGFWpS", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-30 19:06:26"}
{"_id": "qho8myujvfdcCrGqy", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "G5GaC8Z8QDaxuTPbk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:36:53"}
{"_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": "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": "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": "2e7SWPEE3PyJZWXBx", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\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 | 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 | 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,t2:Teacher | all 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  \tall c:Class, s:Student,  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\t\n   \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/* 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) implies ( (t->c in Teaches) 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": "QtZGEx8tetH3Y9ttm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-4 22:09:33"}
{"_id": "nR8JsMTTySuudEhio", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person -> Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DJzW4vbMjBbNshEyz", "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": "2020-10-28 14:19:24"}
{"_id": "TBvP3tNH2PBGEkJGN", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> 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/* 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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | some p: Person, g : Group | x->p->g in Groups implies some t : Teacher | t->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": "KrdFK33Ngkg2NjvxC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:25:42"}
{"_id": "DsbL8QTecxTnx2Qdo", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tsome t: Teacher |some g:Group |some c:Class | some 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": "MCfcq99reQKxgtRH4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 12:53:12"}
{"_id": "rat48DpoYYPzYSrHS", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t->c1 in Teaches and t->c2 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": "38ggQzT24P77uP6pN", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:49:15"}
{"_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": "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": "FEAriBMRgCYj9Jc7p", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all 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  all t : Teacher | some p : Person, c : Class, 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 | (some g:Group | c->s->g in Groups) implies  (all t:Person| 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": "Y5RqJMjdGcyPv7soL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:38:44"}
{"_id": "ae3MMNEwbbfpFR4Sg", "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 f : Person | f in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall f : Person | f not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall f : Person | f 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\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class, 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": "gCH76mnjYY8kNqvj6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:52:07"}
{"_id": "qwv6rPmFYgsh6Ff2n", "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  some Person : Person | Teacher\n}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\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": "2020-10-28 14:17:57"}
{"_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": "Km8EQ4g7rjx635dW9", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, g:Groups | some t:Teacher | g in c.Groups.Group 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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TSLAc4yn4LS9KMrfa", "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}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 15:06:54"}
{"_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": "3k3Bw3nxcdr3wZuZj", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  some t: Teacher | t.Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nqeWAt8oAx2wbAEWB", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:45:54"}
{"_id": "4FRCxFJv86rsaemb2", "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\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t(all t : Teacher | some c : Class | 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": "YH3ANm7Y5Qe5dSYem", "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-10-28 22:47:09"}
{"_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": "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": "voh7WNiQGCktRWHSa", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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": "Gd596nAmCwHo5BrYZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 12:14:54"}
{"_id": "pwAt7Ns8FgbwzAa9r", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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  some c:Class ,g:Groups ,t:Teacher| all s :Students | c->(s->g) in Groups 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": "mRJ7Qy2CFsbHr47DM", "msg": "The name \"Students\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 13:58:15"}
{"_id": "2LB4NjdxF9gAv5rHz", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | some p: Person, g : Groups, x->p->g in Class implies p->g 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": "Z9mKHYxGA2a2PSEmH", "msg": "There are 3 possible tokens that can appear here:\n,  : =", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:17:43"}
{"_id": "8sNSNv9SWkCXXY3xv", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> t -> 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\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "etHTucHns9R4mcrJd", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:32:33"}
{"_id": "6oiEKbmEdnLnckpz8", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all 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  all t : Teacher , some p : Person, c : Class, 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4RLWbaM2iZnWccyRa", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:10:04"}
{"_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": "4R2XpHAseZ2rXtQRc", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, 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\tall t: Teacher | some c: Class, g: Group, 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\tall p,pp: Person | p->pp in Tutors implies p in Teacher and pp in 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, t : Person, c : Class, 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": "hCmA8usnLCT5qcraa", "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": 292.49609375, "y": 199}, "Class1": {"x": 584.9921875, "y": 199}, "Class2": {"x": 877.48828125, "y": 199}, "Group0": {"x": 292.49609375, "y": 298.5}, "Group1": {"x": 584.9921875, "y": 298.5}, "Group2": {"x": 877.48828125, "y": 298.5}, "Person": {"x": 584.9921875, "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": "2020-10-29 10:31:01"}
{"_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": "vCeXYQ6GbTLkjHQbA", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | some t:Teacher |some g:Groups| g in c 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": "bkyZxLkXoZak2h5HL", "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": "2020-10-27 12:37:51"}
{"_id": "tJX3Hg7csaKoXyvav", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 g : Group, c : Class, t : Teacher | \n  \t\t(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": "qHgESs3cwfkHDAJPq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:53:15"}
{"_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": "vEkqCM6FfAn8jRNy7", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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 | all p : Person,  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher, c : Class | all 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/* 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": "Wy2nPGGrT5NDLLYfZ", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 01:51:32"}
{"_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": "ZnRLwYpyyAwngSrfF", "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-10-27 20:45:56"}
{"_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": "C3SJpjMoseYPHJTCY", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x : Person | some c : Class | x->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": "Jw5JCGzBcXBTKh9Ft", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:14:17"}
{"_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": "rFj8e2cqvNcwAdEe5", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tsome t: Teacher | all s :Student|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\n}", "derivationOf": "ZPrz5KjNiFmA4Nezv", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 13:15:08"}
{"_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": "NR4DQjBogZ9RSQMkm", "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\t(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\t(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\t(all c : Class, t : Teacher | t->c in Class implies (some g : Group, s : Student | 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\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": "SnMMaiXAjwHutycRz", "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": "2020-10-29 09:23:41"}
{"_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": "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": "5bW2CEZpyTLTAquZY", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | all s :Student|some g:Group |some c:Class | 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": "Ng3njXHSFjgzHiWpR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 13:18:08"}
{"_id": "WFjgMh7PNvhtMkhtP", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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\tall p1, p2 : Person\n  \t\t| 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\tall p1,p2,p3 : Person\n  \t\t| p1 in Teacher or\n  \t\t| (p2->p1 in Tutors and p2 in Teacher) or\n  \t\t| (p3->p2 in Tutors and p2->p1 Tutors and p3 in Teacher)\n}", "derivationOf": "HfKvgzXiKxiuwDbDJ", "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": "2020-10-28 22:01:40"}
{"_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": "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": "3TLgRjRbNXp3eHAFf", "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": "2020-10-28 21:19:51"}
{"_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": "FLxaNwE6wRaEGE53R", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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  some c:Class |some g:Groups | all s :Student | 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\n}", "derivationOf": "XFSw7d9mGzi6yL2Hz", "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-10-27 14:13:29"}
{"_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": "bqELzhq3ustvJgHjh", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some t:Teacher, p:Person | p in c.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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FeT5jaeFFfpxNXEue", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 15:09:38"}
{"_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": "jocaGDaCYr4YGfFpf", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t(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\t(all c : Class | some s : Student | some 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\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": "b4gJgNZWRQ36SP5ev", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:12:49"}
{"_id": "uwt7h8wR2pTAzBo8X", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sf5qY9Kb8sCwZX6wi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 14:14:58"}
{"_id": "x2NHqrBmzxdx5Jiix", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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\tsome 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": "M9dHrz9bSWkAbc8Y7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:48:32"}
{"_id": "qfxwdqb3iQiWitFPg", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall t: Teacher , x :Class | (some g : Group | x->t->g in Groups) implies t->g in Tutors \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": "N24BYPsSS3HMwF83b", "msg": "The name \"g\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:09:43"}
{"_id": "vaEtRCt9xyfHSJfyC", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DgaFZJdR4RsgDGBAz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 20:58:29"}
{"_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": "8M4PRjdLP9pkEKvSY", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t, p : Person | (c->p->g in Groups) implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */ \npred inv12 {\n  all t : Teacher, c : Class | some g : Group, p : Person | p in Group implies t->c in Teaches\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9xqWgqK4GuPvLwQCE", "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": "2020-10-29 10:32:27"}
{"_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": "7c9GyWK5awXpDo4ax", "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 in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QeHizhXtvDw75kPyr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 21:20:56"}
{"_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": "nLa9k9Ckii37357YH", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student, 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": "tqZkt9XFhdEyHZvRo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:30:06"}
{"_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": "ZRjczWqfATgCzoEHg", "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 {\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": "Ln7LxBLQvqCoB3nfL", "msg": "The name \"student\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 11:17:24"}
{"_id": "BM8HcikX2jv2pmiB4", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student, 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/* 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": "4Xj3gdzDfR6trwdxQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:47:33"}
{"_id": "YDgLoeeqwntvEWrGC", "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\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class, all t : Teacher | c 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": "YH3ANm7Y5Qe5dSYem", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-11-5 11:02:19"}
{"_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": "Z8dPBfDhDd5H54AsK", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x not in Teacher\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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all 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": "z4AH6h2bZ3cKippd3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:07:50"}
{"_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": "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": "YdbgemJRrxzSs8AYE", "cmd_i": 13, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tsome s :Student | some c:Class | some g:Group | c->s->g in Groups and (some t:Teacher t->c) implies t->s in Tutors\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "urTH8oDMDXWywoEyC", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:55:03"}
{"_id": "4beRYubzrb7H3TsZz", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> 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/* 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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | some p: Person, g : Group | x->p->g in Groups implies some t : Teacher | t->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": "4aMhL2qX5LwCEusXY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:27:59"}
{"_id": "SWgxbRRivg6rqgFwb", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  some x : Class, p: Person, g : Group | x->p->g in Groups implies (lone t : Teacher | t->x in Teaches)\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "6wucCskSSpNwGRrty", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:54:29"}
{"_id": "Ca5JJaRYuZswKfhGg", "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 all 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 Teacher implies p not in Student) or (p not in Teacher implies p in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AiggxoZH3pRQrDFj4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:32:12"}
{"_id": "rYbsFj7SGMBAKA79o", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group | 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": "8fEbSFk4DTWfjtgTC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 19:01:51"}
{"_id": "vRJvEMnXACPm3crid", "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, 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": "T5XkeHoaRsuHoXbRR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:11:14"}
{"_id": "f3DAkG73bphg6zZJw", "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\n/* Some persons are 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\npred inv2 {\n\tall f: File | f in Trash\n}\n\n\npred inv3 {\n\tsome f: File | f in Trash \n}\n\n\npred inv4 {\n\tall p: Protected | p not in Trash\n}\n\n\npred inv5 {\n\tall f: File | f not in Protected implies f in Trash\n}\n\n\npred inv6 {\n\tall f1,  f2, f3: File | f1->f2 in link and f1->f3 in link implies f2=f3\n}\n\n\npred inv7 {\n\tall f, f1: File | f->f1 in link implies f1 not in Trash\n}\n\n\npred inv8 {\n\tall f: File | no f.link\n}\n\n\npred inv9 {\n\tall f1: File | all f2 : f1.link | no f2.link\n}\n\n\npred inv10 {\n\tall f: File | f.link in Trash implies f in Trash\n}", "derivationOf": "hYWF5qbWPTp3ieCcE", "msg": "The name \"File\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 12:46:36"}
{"_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": "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": "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": "d4ggBMQzDLhzaw3H5", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 { \n  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": "SuSaPz335JNiMPer7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:00:44"}
{"_id": "NzRr6rsuB7XcpMNtF", "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\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 | 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,t2:Teacher | all 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\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\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": "BLxgtgSqLxqM6CuPx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-4 20:55:24"}
{"_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": "jd7647kXTGBqJb3Dw", "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\tPerson = 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": "gYZrehN4sRmspgWgG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-9-30 10:00:56"}
{"_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": "TWx8ceGZJpzFMRkxn", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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 p1, p2, p3 : Person\n  \t\t| (p2->p1 in Tutors and p2 in Teacher) or\n  \t\t  (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher)\n}", "derivationOf": "LZib767ej4y3BunqA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:43:58"}
{"_id": "mDmQdjfpWAFe2GuZs", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, g : Group, p : Person, 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\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\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tRZRhbnwMByk8HDxx", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:04:27"}
{"_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": "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": "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": "7Da5PsQqP3EXH4iyM", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent = Person - Teacher  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\n\tall x : Person | x in Student or x 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": "xkhmQuxwznG5w6qfc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:09:07"}
{"_id": "CdtZz78WQvzJtcNPm", "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-10-29 08:56:14"}
{"_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": "dmtGa4z9QXpsymGMa", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 g : Group, c : Class, t : Teacher | \n  \t\t(c -> s -> g in Groups and t -> c in Teaches) and (p2 -> p1 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": "sfNKm8YXwSFq6iGKi", "msg": "The name \"p2\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:50:46"}
{"_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": "HZys8YWrFQcQyn9oC", "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\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "mpNKPGqispNGdx6Zr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:01:32"}
{"_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": "bkyZxLkXoZak2h5HL", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bLTihbwrzFCbM9zj7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 12:30:31"}
{"_id": "7pM3XM8iHhrRztzei", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | (some g:Group | c->s->g in Groups) implies (all t:Teacher | t->c in Teaches implies t->s in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EuueiHypv4wm7zBZh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:26:14"}
{"_id": "AiggxoZH3pRQrDFj4", "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 all 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 Teacher implies p not in Student)or(p not in Teacher implies p in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ruFLuAEotSG87mWMb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 18:25:57"}
{"_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": "acjrhk8APzkH3NnE9", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t : Teacher | some 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  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* 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 | all g : Group | \n    ((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": "DtCozHfucgg3zuZn5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:10:25"}
{"_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": "4rPoCeGBagbJo7sJs", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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": "5Bnuye9X6MAyFGR3p", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:49:43"}
{"_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": "J7iksNr3KkcE5gCTg", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 | lone c : Class | t->c in Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4JFm795AxGiMRR8DK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-5 09:00:59"}
{"_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": "N64hLYYqCLCH4FDwy", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  \tall x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x 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 x : Teacher | some y : Class | x -> y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  \tall c : Class | all t, x : Teacher | t -> c in Teaches and x -> c in Teaches implies t = x\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, t : Student | some g : Group | c -> t -> 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/* 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 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": "ajHpNhYq9LfqQeJfm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:53:41"}
{"_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": "wL95TjK9W8hucaNqe", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c:Class, t:Teacher | some g:Group | c->g in c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jTJ7xb3XZhs5YwJZn", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Group}\nRight type = {this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 16:04:47"}
{"_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": "bdXYDrqGBy2SafdgP", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some t:Teacher,g:Group,p:Person | (g->p in c.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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gSetSkSseThAdt6Xf", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Group->this/Person}\nRight type = {this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 15:16:08"}
{"_id": "3wudnJQZy8N9HB5Cj", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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, g : Group | some t : Person | c->s->g in Groups and t in Teacher and s in Student 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": "c33QXDkwxiZKwoiTZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:33:06"}
{"_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": "XZGRCAEDrQCTmyh5h", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, g : Group | some c : Class, t : Teacher | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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\tall p1, p2, p3 : Person | (p1 -> p2 in Tutors implies p2 in Teacher) or (p1 -> p2 in Tutors and p2 -> p3 in Tutors implies p3 in Teacher)\n\t\tor p1 in Teacher\n}", "derivationOf": "itqjeRjfyaRRtrxsd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:59:07"}
{"_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": "2PHevayqdvuitjGpp", "cmd_i": 11, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 implies (some c:Class | t->c in Teaches) implies (some g:Group |all p:Person | 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\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "2kAbDtd3ipGdWTo4E", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:40:20"}
{"_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": "RfRtmWZ7pXxDA69HK", "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 p : Person, c : Class | some p.(c.Groups) implies Teaches.c in Tutors.p\n\n}\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-12-2 17:38:51"}
{"_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": "9SJtjX2sFRG4KppNQ", "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\npred inv4 {\n\tall p : Person | not (p in Student and 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": "s6FDAfoZwEXJ7eWfZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 20:54:33"}
{"_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": "R3A6HoFPa2nngaKnx", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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": "TnAZxx2D4jmsGJxEM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:19:48"}
{"_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": "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": "24ccfudCWacPrfGZr", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, p1, p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p1->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": "j6aWr8TXoQHoqgKf4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:05:08"}
{"_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": "Wsa9YRRF2e2Xwo4b4", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | 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": "sJEaXCaXEkZqdp5Rz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:17:20"}
{"_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": "5dmBQdag4unR6mf3t", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tsome s :Student | some c:Class | some g:Group | c->s->g in Groups and (some t:Teacher| t->c in Teaches implies t->s in Tutors)\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "66JJEQ7yA7RZNq3NW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:59:50"}
{"_id": "ZRc6vFxGY5pk27rBm", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\t\n  \t(all c : Class, p : Teacher | p -> c in Teaches) and \n\t\t(all g : Group, c : Class, p : Person | c -> p -> g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "23ihDZRmvmebJpQMh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 03:16:07"}
{"_id": "cb8iGm7Z6uAyHsDWD", "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 Teacher implies p not in Student) and (p in Student 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 Teacher and p not 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": "7ioiprLMKuXZCK37f", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 13:22:48"}
{"_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": "v2EjKBzQQLf69xjdc", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone c: 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": "eTWyThDcyPpCbrW2y", "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": "2020-10-27 14:43:10"}
{"_id": "mRxGRbJp8mqmz4iKv", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x not in Teacher\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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all 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": "AKJPb9r7XBkc2cBJD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:07:38"}
{"_id": "wh3cgxR9c5TkxyPuf", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall x : Teacher | all c : Class | x->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": "zf9nGfW5tSsBz8nHG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:17:25"}
{"_id": "PcfCSoKMzDBapvsWH", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, t : Teacher | t -> c in Teaches implies some g : Group | c -> p -> g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "BQyzdrzhX7mqkNNG8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 02:30:33"}
{"_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": "TYBPRvu3872TWMCfN", "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 => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, some t : Teacher, some g : Group | c->t->g in Groups\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mFauMorYkS2juzQhp", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-30 19:15:31"}
{"_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": "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": "ByBGcPnrvGoQczh6F", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t : Teacher | c->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\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* 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\n}", "derivationOf": "L4gxoTtCwDPKsDW5y", "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": "2020-10-29 10:06:59"}
{"_id": "fth6Dvz5Gw7GmdjWy", "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\t(some t : Teacher, s : Student | t->s in Tutors implies 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": "wMEXeSPypGqng3bGo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:32:08"}
{"_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": "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": "dSPPsZQqveNc5CKx8", "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\t\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\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 | all 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\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "N5RptXchd77fW6oQi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:08:13"}
{"_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": "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": "Xrar9HZu6S5Bn6sf5", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\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-10-29 09:07:38"}
{"_id": "xZsgr9bijPaahGJyX", "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/* 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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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  all 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  all p1, p2 : Person{\n    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  all s : Student, c : Class, g : Group | all t : Teacher | (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": "XHuX9ZvQn6LbA8sNo", "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-10-29 09:51:35"}
{"_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": "FQ4Tbg6i6aEjYBF9W", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student, 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  all t : Teacher, c : Class | some g : Group | c->t->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": "W3ChKqRshZF6qqSim", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:34:59"}
{"_id": "N24BYPsSS3HMwF83b", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall t: Teacher , x :Class | (some g : Group | x->p->g in Groups) implies t->g in Tutors \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": "koYctT7yFepd4kzEQ", "msg": "The name \"p\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:09:27"}
{"_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": "Rt6LxZbmFDrCgTwNg", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall 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": "bfTWyo7LmLPmhfYvk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:30:59"}
{"_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": "yFo8FPCgm3tCrkQb2", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n  all ps,t : Person | some c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TL5dYL6oN6LLbvHEt", "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": "2020-10-29 11:37:20"}
{"_id": "AyREteDziocojkZNT", "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 f : Person | f in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall f : Person | f not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall f : Person | f 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\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YxRr3XR62P6Md3wpD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:18:52"}
{"_id": "DrxWuYvZLjBznzeNJ", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aGr78E2hJDw8Ao43K", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:01:19"}
{"_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": "26CmABvo6rns5uWFf", "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 p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, p1, p2 : Person {\n    (p1 in Teacher and p1->c Teaches)\n    implies\n    (p1->p2 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": "kcNXjBDs8uwMqxKmB", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:02:48"}
{"_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": "QeLANNvoWaRa3JF5Q", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t: Teacher| some x:Class | t->x in Teaches implies some g:Group | x->g in Groups \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\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": "EM3K3aZtCr4QqkGKB", "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": "2020-10-29 10:29:59"}
{"_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": "833scFvnDaDJk2JS8", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xSjn5fkS586YrFYPA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:14:03"}
{"_id": "FZ3ufMrA73926sdwM", "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\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 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 | all 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 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": "gLJpYcLFr555iPTri", "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": "2020-10-29 09:20:37"}
{"_id": "R3Rq3jmoH96oPFHfo", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t: Teacher | t.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": "CJYfie9zZSCKeHfEx", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 15:11:26"}
{"_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": "KwRrS5am4pohrWJqw", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 | some t.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": "s289q9L35foXxcMMo", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:27:34"}
{"_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": "dEoe4PYGehnPQvGnT", "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 {\n  all p:Person | p not in Teacher\n\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) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Wy6Ys7nva9xnpFdZq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 11:21:30"}
{"_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": "5WMiECaNuwpvCQpbX", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZXWrEouA9RtDb5yQJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:05:19"}
{"_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": "b8QdaqThJCYvQj8EZ", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | all t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\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\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 c:Class | some g:Group | c->t->g in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tsome 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": "WReRAT2CCqoaG4H6i", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2021-1-12 01:08:06"}
{"_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": "95TqE6scMwSvmBzmi", "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\t(all 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\t(all t : Teacher | all c,u : Class | (t->c in Teaches and t->u in Teaches) implies c=u)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2jPq4PKYKApqhjH6n", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 22:51:33"}
{"_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": "YPsLzNm4qf6j6Xf4z", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (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\tall p:Person | p in Teaches implies p 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": "359SpJSSuBH3qpE3v", "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-10-29 09:32:31"}
{"_id": "YfbmTsqareMHMyvRi", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "rmo7nAPmjWPmqaMuK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:19:11"}
{"_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": "bEX6beEjK37mx5sbh", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\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\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "QWPWEYSnABvcWE59R", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:20:28"}
{"_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": "ubnxaAwrSFeSuyLw7", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\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": "W3zMxAS4H8MWEBWuq", "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-10-28 15:11:59"}
{"_id": "T22ZFmNcXW8LxtFZu", "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\t(some t : Teacher, s : Student | s->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": "RmnPfqqufiBkvX3v8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:33:50"}
{"_id": "LZib767ej4y3BunqA", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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 p1, p2, p3 : Person\n  \t\t| (p2->p1 in Tutors and p2 in Teacher) or\n  \t\t  (p3->p2 in Tutors and p2->p1 in Teacher)\n}", "derivationOf": "38RQpXh49c93zv4Lq", "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": "2020-10-29 09:43:45"}
{"_id": "X5CaqQ5mZbBpdg6jX", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \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  all 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 , t : Teacher | some g : Group | ((c->s->g in Groups)and(c->t->g in Groups)) 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": "bRrPenRTiNx8kdKZ5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:45:12"}
{"_id": "fQ4H44JtD7ahmKHPL", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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\tall t: Teacher | some  c: Class | some g: Group | all p: Person | t->c in Teaches implies c->p->g in Groups and p in Student\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nyS5jqFzZ8vkFqCu3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:34:01"}
{"_id": "ExGNp26J2kZofu46w", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "r9vmwFKLXrP6aZLFc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:17:10"}
{"_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": "SiDzpt6pZuaLPjTtJ", "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 | 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/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "umaC8KPgo7DtXrnsr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:16:07"}
{"_id": "tr7GfZsDysHm6TZ29", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Person | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->(s->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, g : Group | some t : Person | c->s->g in Groups and t->c in Teaches and t in Teacher and s in Student 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": "t3tb8Gn4EeSndmrXG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:15:13"}
{"_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": "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": "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": "Q7ESs9begq5ZrGvas", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  all p : Person | p in Teacher implies p in Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6vMvYdqwch6NxE8mB", "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": "2020-10-29 09:12:51"}
{"_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": "NEGDP5PAXfsqyFuuk", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n  all t : Teacher  | (all c : Class, g : Groups, p : Person | t -> c in Teaches)\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "fghx3zKZiBBui66t4", "msg": "Analysis cannot be performed since it requires higher-order quantification that could not be skolemized.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:14:25"}
{"_id": "3ZqsGa5e5oSDc2w8p", "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 Teacher implies p not in Student) and (p in Student implies p not in 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\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\tsome 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": "i2bWcWakQCqLeaWrf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 13:44:40"}
{"_id": "AFE9Sse33emvMxdxZ", "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\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall 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 Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s,t:Person | all c:Class | 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\tall s:Person | all c:Class | all g:Group | (c->(s->g) in Groups implies (all t:Teacher | t->c in Teaches implies t->s in Tutors))\n}", "derivationOf": "km86yE62neSLKroAC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:43:58"}
{"_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": "SPW9wmfq4m2TdEdDd", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 p1, p2 : Person, c : Class | (some g : Group | c -> p2 -> g in Groups) and \n\t\tp1 -> c in Teaches and p1 -> p2 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": "26LcPxs45axfhSC4w", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:24:41"}
{"_id": "GJmSKhsJbSu2EuPBo", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7mitjR7r7gaGgMMaZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:10:10"}
{"_id": "BvS5FDNGDDnCe2Zdf", "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 Teacher implies p not in Student) and (p in Student implies p not in Teacher)\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 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\t all c : Class, s : Student | some g : Group | 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": "2zn6t59zxGJP7xDDi", "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": "2020-10-27 14:01:54"}
{"_id": "TEYWx3MqX9tBAn8zE", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s,t:Person | all c:Class | 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\t\n}", "derivationOf": "sP9sKeeeAf88Qb875", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:47:54"}
{"_id": "Xi6wrWuAZAdzDyejT", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n  all t : Teacher, c : Class  | t -> c in Teaches implies (all p : Person, g : Group | c -> p -> g in Groups)\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "gMiyBnbzA7XEZ553G", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:17:34"}
{"_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": "HyDCrtt5BcDYxcvdP", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, g : Group | some c : Class, t : Teacher | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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\tall p : Person | some p1 : Person | p -> p1 in Tutors implies p1 in Teacher\n}", "derivationOf": "2ZWZHgWbnnQ5cZxHW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 00:10:14"}
{"_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": "9BddqksdAZEWyqhmK", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 p:Person | all 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\n}", "derivationOf": "6cXukdxWY4iBWZSdJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:43:41"}
{"_id": "Yz22mWvMuKZdrMQJB", "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 Teacher implies p not in Student) and (p in Student implies p not in Teacher)\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 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\t all c : Class, s : Student, bg : Groups | some g : Group | s->g in c->bg\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Evkir3Png8ZX6m6H8", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class->this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:03:20"}
{"_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": "XHBGinx96yFLZhADk", "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 | 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 | 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,t2:Teacher | all 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 | 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\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": "zBGMCi32NvzzXMw5o", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:50:32"}
{"_id": "C9WDjyY3mPfufyY3t", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n/* 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 Tutors.Tutors.Tutors\n}", "derivationOf": "t25NRtNP4qSq8u8Xp", "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-10-30 22:37:05"}
{"_id": "SLhmhazH7GJBhxfeb", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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 \tall t:Teacher | some c:Class | (some g:Group | c->t->g in Groups) implies t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by 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}", "derivationOf": "r24kbHneKGqZCBEun", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:51:41"}
{"_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": "qXbXMCxZTCkfKuRGd", "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  all s : Person | s 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": "xjpr97s26h5KA7Yqx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 19:28:00"}
{"_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": "NsETpBoYhmfQcRRc9", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\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 : Teacher | some t : Teacher | t in p.Tutors || t in p.Tutors.Tutors\n}", "derivationOf": "EouBf3DAh4GzMoDbT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-31 00:06: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": "57gRRqb25JF2mvMsn", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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  some c:Class ,g:Groups ,t:Teacher| all s :Student | (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": "PB8K3ME7o5LYNmJam", "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-10-27 13:59:57"}
{"_id": "8W6kBSFpM9mhFauuN", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tsome s :Student | some c:Class | some g:Group | c->s->g in Groups and (some t:Teacher| t->c in Teaches implies t->s in Tutors)\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "j7mEM2Za2JKT5AFnw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:07:39"}
{"_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": "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": "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": "xoAWtavvtmv3BXb6m", "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 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": "m7h5Li6h9m2PYHiJy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 23:44:51"}
{"_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": "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": "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": "38RQpXh49c93zv4Lq", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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 p1, p2 : Person\n  \t\t| p2->p1 in Tutors and p2 in Teacher\n}", "derivationOf": "tLym9yKBhrChYaHDe", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:42:52"}
{"_id": "SufSzbAGXhB9eJsqP", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t : Teacher | some 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  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "acjrhk8APzkH3NnE9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:11:04"}
{"_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": "nNjWmodAKiEh8k566", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group | some p : Person | c->p->g in Groups implies (p->c in Teaches and p in Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all s : Student, c : Class, g : Group, t : Teacher | (t->c in Teaches and 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": "5vtz92toN56fTzQDE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:43:19"}
{"_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": "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": "XEm5rjQ5z6mkWJSxE", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all 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  all t : Teacher | some p : Person, c : Class, 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 t : Teacher, p : Person | some c : Class, g : Group | t->p in Tutors implies (t->c in Teaches and c->p->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": "5uRayQXmKqtLQTyuX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:12:34"}
{"_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": "fvARtKQPojcSHgu2W", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group | some t : Teacher | c->t->g in Groups and t->c in Teaches\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  all 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\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\n}", "derivationOf": "GfeGbEyWmZw7rqyrx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:05:53"}
{"_id": "xbjpsBFD65fEyzQH5", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all 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\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ppGDJxTi249eDKvoW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:30:29"}
{"_id": "ph8uKaKdxBvSnd7JN", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some t:Teacher,g:Group,p:Person | (p->g in c.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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2ZCBtnzd9aXz4MTH7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 15:15:43"}
{"_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": "7Dre8ZzkC6X2X7khD", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 | all c:Class | some t:Teacher | t->c in Teaches and 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/* all p1,p2,p3:Person \n}", "derivationOf": "Ks7THEbhJHyGZpnjC", "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-10-29 10:23:44"}
{"_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": "jTTD7CLgz7fzG6bYL", "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\tall t:Teacher | Teaches in iden\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno t:Teacher | t 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": "XE5FLbKYFLWGPd6Rz", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-6-14 22:52:35"}
{"_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": "wERiE9imcKaWnxMzm", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\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/* 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-11-5 08:57:35"}
{"_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": "T7poFHwm83cTSJY22", "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 all 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 Teacher and p not in Student)or(p not in Teacher and p in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "L6YAkCLMHBpn5TPF4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 17:49:41"}
{"_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": "BmH8frhGGYN9kAZyc", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all t : Teacher, 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "nmzdwQjmyaHjuQBPR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:08:39"}
{"_id": "BEtnXi4jvCJhPnNAH", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\tall c : Class, g : Person -> Group | c->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": "Ljjn8ofnJ3y6XzzmE", "msg": "Analysis cannot be performed since it requires higher-order quantification that could not be skolemized.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 19:59:39"}
{"_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": "2zn6t59zxGJP7xDDi", "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 Teacher implies p not in Student) and (p in Student implies p not in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n  \tPerson = Teacher+Student\n}\n\n/* There 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\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": "2MDQ6F4L9giJNJZL7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 13:55:26"}
{"_id": "ScaqCdcPiXNhDWTyj", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some g:Group |some 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\t\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 p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n\tall s:Student,t:Teacher | some g:Group,c:Class | 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": "XwX8tdS6Dv3i9ypwD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:32:20"}
{"_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": "Q2jRb72tr23Mi2vhD", "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 p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group | some p : Person | c->p->g in Groups implies (p->c in Teaches and p in Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all s : Student, c : Class | some t : Teacher | c->s 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": "Y2yetiL6D8FuRoWSG", "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-10-29 09:37:40"}
{"_id": "HnqYTBHpB5RaB5gGb", "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\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "8QjsvnBcJ7LeYcuaY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:15:02"}
{"_id": "yHnipcdwdA8zb6Fvg", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches implies (some g:Group |all s:Student | c->s->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\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "bSNcqy4Pmwrnwzp4a", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:33:36"}
{"_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": "LhHRZe9CiKqSLpSS9", "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 {\nno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nnot (some p : Person | p in Student and p 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 Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall 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 {\nall 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 {\nall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class, 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 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 {\nall 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": "B5Lnafh3fryfbtYiA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 22:00:28"}
{"_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": "2ZCBtnzd9aXz4MTH7", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some t:Teacher,g:Group,p:Person | p->g in c.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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MpwpjynRmXakzh8gq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 15:15:11"}
{"_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": "NvGbKaJ3micxZTe8a", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student, 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {  all f,l,u : File | f->l in link and f->u in link implies l = u \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": "NoxarSabTzFtNBmRT", "msg": "The name \"File\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:43:45"}
{"_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": "j3bPSaPPzKcG3vzHY", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6oJ76mQeKQiegQFBk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 12:02:14"}
{"_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": "zjQgXT9RHBAJwttw6", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nqZnKayvWpXjZGXhi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 21:15:14"}
{"_id": "HMLQxafNRfj6JrTRD", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some c.Groups) implies (some (Teacher & c.~Teaches))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some (t.Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n  all p : Person {\n  \t(some (p.(~Tutors) & Teacher)) or\n  \t(some (p.(~Tutors).(~Tutors) & Teacher)) or\n\t(some (p.(~Tutors).(~Tutors).(~Tutors) & Teacher))\n  }\n}", "derivationOf": "Gr25LBSiiLJSdrGLn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:11:35"}
{"_id": "7wRCyDwGk3ef6v2tX", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all t : Teacher | all c : Class, s : Student, 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": "3yWTGXdv2A2xmxadL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:31:35"}
{"_id": "gJChH6vjtqmcECWmx", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CczekskNpyJAtMd6i", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:52:23"}
{"_id": "4ybG7uAvhmGaHeExy", "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 Teacher implies p not in Student) and (p in Student implies p not in 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\tsome 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": "LWpjRKdCEhyA8iGGF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 13:40:46"}
{"_id": "N98Qgou6dpybxiRvC", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\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/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZEfzwZR8aowENnvyf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 22:55:23"}
{"_id": "SMuL6QEd4BYDQF4im", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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": "XkP35wBfMfuYQPwrH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:02:05"}
{"_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": "tk2i4Fj3zbKZ5iEi3", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 (Person-Student-Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t:Teacher | some t.Teaches\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some( c.~Teaches & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone c.Teahces\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sMsE94cqYsheE3yuw", "msg": "The name \"Teahces\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2021-1-13 18:23:02"}
{"_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": "DBqNYAdeuEgXudxgR", "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": "WYE8KhXKopnn3cijc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:17:13"}
{"_id": "tiMLyR85TYSPKhka8", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JysLpxhcLig5FHYpJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 14:57:12"}
{"_id": "3rK2cP4xkmLgfDyys", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Person | some c : Class, s : Person, g : Group | t in Teacher and s in Student implies  c->s->g in Groups and t->c in Teaches \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 { \n  all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n  all s : Person, c : Class, g : Group | some t : Person | c->s->g in Groups and t->c in Teaches and t in Teacher and s in Student\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "j5jzLrNy5m6vHSaeL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:11:24"}
{"_id": "L9wBkeo2Absxrmkq6", "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": "3TLgRjRbNXp3eHAFf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 21:20:10"}
{"_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": "9ASroDBoPXJBNmKCb", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t, p : Person | (c->p->g in Groups and c->t->g in Groups) implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */ \npred inv12 {\n  all t : Teacher, c : Class | some g : Group, p : Person | p in Group implies t->c in Teaches\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WAoKMF2SykTGdefWJ", "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": "2020-10-29 10:28:15"}
{"_id": "tb6JAoGcggkaQoY6c", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tall s :Student | all c:Class | some g:Group | c->s->g in Groups implies  (some t:Teacher| t->c in Teaches implies t->s in Tutors)\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "3CE4Jz7DKmwDn4tN2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:16:02"}
{"_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": "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": "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": "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": "Rg92fmDdnTTa9PRc6", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NDryhFQa7xAcXHe84", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:04:04"}
{"_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": "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": "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": "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": "RRthQyznfmuWZ7Lcm", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \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  all 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\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qWx87EJweyzBaiDd2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:31:15"}
{"_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": "rps9Gr7ABvBzaE7ZH", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  implies (some t:Teacher | t->c in Teaches )\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tsome t: Teacher |all c:Class | t->c in Teaches implies (some g:Group |some p:Person | 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\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "ZS8G2HBXcKj4ckZan", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:30:34"}
{"_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": "9mZjS9Qu7N7jJ2Wts", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  all c : Class | t : Teacher | 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\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Pc9KbKPFMkoH8Wk48", "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-10-28 15:29:53"}
{"_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": "jjvctP7a2AmmMrngK", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YTZzvyF3SnvWNm9bY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:43:18"}
{"_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": "FeT5jaeFFfpxNXEue", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, pg:Person->Group | some t:Teacher | pg in c.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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "g7dyxoASeFACeg4ys", "msg": "Analysis cannot be performed since it requires higher-order quantification that could not be skolemized.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 15:07:39"}
{"_id": "A29AJ6ciSdj6Q5pA7", "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\tTeaches in iden\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno t:Teacher | t 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": "jTTD7CLgz7fzG6bYL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-6-14 22:52:44"}
{"_id": "baFcuCvsCNhJBdd7R", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n  all ps : Person, t : Teacher | some c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps 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": "ft2Q8x9bQa59gFBR4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 11:40:30"}
{"_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": "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": "oGipriEK8DMmHmKEe", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (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": "jTJNosSGFeSBc7QeL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:21:18"}
{"_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": "3BH4wxf8WPaMPeo4z", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "fXD3ydAucxS9hfJ4p", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:45:39"}
{"_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": "dyCve3FTyZszRZDYH", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\tall c : Class, t : Teacher, p : Person, g : Group | (t -> c not in Teaches) and (c -> p -> g not in Groups) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "HHaamY2mgreboa4mc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 02:51:26"}
{"_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": "k5Fi6f6rRZdTpjFTH", "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  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student, some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "ynFbTKeZx6MoE3ZFy", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:18:16"}
{"_id": "huDYb6ANtFTgJ8gyq", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, g : Group | some c : Class, t : Teacher | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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\tall p1, p2, p3 : Person | (p1 -> p2 in Tutors and p2 -> p3 in Tutors) implies p3 in Teacher\n}", "derivationOf": "NiqmksMFjKcYhHNFp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 00:04:12"}
{"_id": "AKkCKeZ6a2fYJ5786", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 (Person-Student-Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t:Teacher | some t.Teaches\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some( c.~Teaches & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t:Teacher | lone t.Teacher\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Aaq3hHPxDMSWSSBqL", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is this/Teacher (type = {this/Person})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2021-1-13 18:21:33"}
{"_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": "2vEm4FQHNpQECkJwp", "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 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  all t: Teacher | some g:Group, c:Class, s:Student | t->c in Teaches  implies 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": "npev6MPmTQbDCgsXz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-4 22:48:34"}
{"_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": "RzQzJj43WCg5rXTzN", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n  all x : Class | (all t : Teacher | t->x in Teaches) implies (some p : Person, g : Group | x -> p -> g in Groups)\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "fJvdtZrFBXKRNgvb6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:08:33"}
{"_id": "N5RptXchd77fW6oQi", "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\t\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\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": "7fWZMaw8vHSDHx3xx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:05:16"}
{"_id": "ixhopsPCwcDs2cqWo", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  some x : Class, p: Person, g : Group | x->p->g in Groups implies (lone t : Teacher | t->p in Tutors)\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "SWgxbRRivg6rqgFwb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:56:30"}
{"_id": "iHquub6sB57R4smcv", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\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, 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 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\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 p1, p2 : Person, c : Class | (some g : Group | c->p1->g in Groups) implies p2->c in Teaches implies p2->p1 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": "x2CtD4rJLSRbMwDqd", "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": 282.75, "y": 99.5}, "Class1": {"x": 424.125, "y": 99.5}, "Class2": {"x": 141.375, "y": 199}, "Group0": {"x": 282.75, "y": 199}, "Group1": {"x": 282.75, "y": 298.5}, "Group2": {"x": 424.125, "y": 199}, "Person": {"x": 141.375, "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": "2020-10-29 10:47:58"}
{"_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": "6bJKADJS6tKAvBHCy", "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\tPerson 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": "82gCBxE4d4ZC6p6AF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-6-14 22:46:10"}
{"_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": "4RLWbaM2iZnWccyRa", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {\n}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all 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/* 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/* 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-10-29 10:08:45"}
{"_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": "swRQMhrN6eW6g2Y7Z", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | all c : Class | x->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": "obRiiKF27ofmm7FEj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:15:37"}
{"_id": "ae8WQqGyt6NGGH2iE", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x not in Teacher\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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all 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  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": "iuvybXQfppsb8gEhG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:06:16"}
{"_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": "iozBAyNwXrSDmBNRr", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches implies (some g:Group |all p:Person | 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\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "mbWtoDmDgHdHx8jhT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:42:39"}
{"_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": "YzipqWMZdZNpsdj7F", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tsome c: Class | lone t: Teacher | 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": "yJfereCR38nBKrbEv", "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": "2020-10-27 14:54:49"}
{"_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": "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": "sP9sKeeeAf88Qb875", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s,t:Person | all c:Class | 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\t\n}", "derivationOf": "tB9mk685L7qon2mxS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:47:52"}
{"_id": "Dt9f7kgx2HaKJpuEC", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\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": "d4ggBMQzDLhzaw3H5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:01:04"}
{"_id": "bkaXMq9Xzyqfpai84", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher, c : Class | all 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/* 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "DRFsS73sQ7EpetR9R", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 01:39:35"}
{"_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": "XWf3YCFXpGCGhMhy2", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n    \n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "XLAajWFFNyioKG9jg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:46:16"}
{"_id": "FPRL4ydbBhL9RMEkN", "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 { all p : Person | p in Student\n  }\n\n  /* There are no teachers. */\npred inv2 { all t : Person | t not in Teacher\n\n  }\n\n/* No person is both a student and a teacher. */\npred inv3 { all p : Person | p in Student or p 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": "LfWo9HwQdC9qzDPf6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:42:37"}
{"_id": "KCGDB69ajbzYkPZbE", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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, g : Group | some t : Person | (c->s->g in Groups and t->c in Teaches and t in Teacher) 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": "3raL7ySq4hQPQbuW6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:22:52"}
{"_id": "wbrDZ6J4FBBR5wvif", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tsome g: Group | lone t: Teacher | t.Teaches in g.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": "6p5twDop9BPX42kXP", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class}\nRight type = {none->none}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:54:12"}
{"_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": "KWY7oPwiNnhxxTQ3j", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone c: 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": "v2EjKBzQQLf69xjdc", "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": "2020-10-27 14:43:20"}
{"_id": "kJMk69YDsyBrWYj34", "cmd_i": 10, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class |some t:Teacher |some g:Group |some p:Person | c->p->g  implies t->c in Teaches \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  all 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\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 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "xHm3jLCAdZby6dKvH", "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-10-29 09:14:27"}
{"_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": "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": "3SinRe9qGFN2TTweu", "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 f : Person | f in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall f : Person | f not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall f : Person | f 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\tall c : Class, 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": "4QyB2bsok5836HNxG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:16:54"}
{"_id": "WPSJ2p8fFeLT25yoW", "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 {\nno 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": "wdhuCvzJWf4DmbLTM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 21:35:15"}
{"_id": "kJDLM4m8cuSftkN7X", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, 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\tall t: Teacher | some c: Class, g: Group, p : Person | c->p->g in Groups and t -> c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall a, b : Person | a -> b in Tutors implies a in Teacher and b in 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 : Person, c : Class, g : Group, t : Teacher | 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": "fq4BWxSkmoLFkwaDG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:29:16"}
{"_id": "xMBijG568fKdG94zJ", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | s->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": "8Ez4QT68hRhWntYnm", "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-10-29 09:53:21"}
{"_id": "Nyz9Kstz44uHWACfd", "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 | 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 | 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,t2:Teacher | all 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\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\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": "Ptv5yn3D2QrMhYKBf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-4 20:56:57"}
{"_id": "n3EKMmz8wLjtYi9NG", "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\t(all s : Student | some g : Group | s->g in Class)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zk4RWeepwumWd8LFY", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 22:59:23"}
{"_id": "v9NHbiMf74eR3La4h", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t: Teacher| some x:Class | t->x in Teaches implies some g:Group | x->t->g in Groups \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\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": "HCn2HA4smKgHDXFmr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-5 11:34:40"}
{"_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": "Ln7LxBLQvqCoB3nfL", "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 {\nall p:Person implies 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": "2020-10-27 11:17:08"}
{"_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": "5Bnuye9X6MAyFGR3p", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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": "T6rRJdAWAD7CGKFw5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:48:58"}
{"_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": "QwSbkCsbfPZNY7eh4", "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, 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 x : Class | (some p : Person, g : Group | x->p->g in Groups) -> \n(some t : Teacher | t->x in Teaches)\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": "nAbkhCimcsr5iqqcR", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:07:42"}
{"_id": "5KsY9E2QSjBFD3ttL", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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\tall t: Teacher | some g: Groups | \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SFLz3T5S3i4gvxhzq", "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": "2020-10-29 12:45:52"}
{"_id": "cMALZE2p4Yz7KNrSN", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\tall c : Class, t : Teacher, p : Person, g : Group | (t -> c not in Teaches and t not in Student) and (c -> p -> g not in Groups) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "dyCve3FTyZszRZDYH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 02:52:06"}
{"_id": "terhLQtq9RijK7YgW", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t: Teacher , x :Class | (t->x in Teaches) implies some g : Group | t->g in Tutors\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": "sZpFg2cYNTdEJRnmZ", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:18:16"}
{"_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": "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": "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": "XRdrYsf3ngygjgoa7", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yibw5gcHp5Y9czWLM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 12:14:40"}
{"_id": "SqPvQFuskS7G4xL6Q", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | some 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 p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WNu35NyYbQCcJWBoy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:17:53"}
{"_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": "gjCfQtZJMvEWtghpP", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tsome t: Teacher | all s :Student|some g:Group |some c:Class | (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": "MsmwkRbmBvFiRHeea", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 12:54:50"}
{"_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": "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": "8gRzMiQQxdjX3Co6W", "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 f : Person | f in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall f : Person | f not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall f : Person | f not 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": "bpoY3FvCX2H2QkwoT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:43:35"}
{"_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": "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": "mwdEHtrGsRr8dhxCE", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 | c->t in Group.Teaches\n}\n\n/* Every 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": "Z74x3rfw5chxBwZJQ", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person}\nRight type = {none}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:35:58"}
{"_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": "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": "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": "wFvmJioFrb364Mdez", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall x : Class | some t : Teacher, g : Group | x -> t -> g in Groups\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall 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": "4yDB62KuPqgiaXyLL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:32:50"}
{"_id": "TWjT6T6E2TPcJfmMj", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher | all c : Class | some d : Class | x->c in Teaches and c!=d implies x->d not in Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "M5tx6aWtr7fWtEeBD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:27:31"}
{"_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": "RDTFA3AhEQwJEeAKu", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 (Person-Student-Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t:Teacher | some t.Teaches\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6zSwXZEJHWPEgx5x3", "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": "2021-1-13 17:46:34"}
{"_id": "DfJHwA5qLg8qnrw4m", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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  lone t: Teacher | some g: Group | some c: Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t: Teacher | all s: Student | t.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": "wEiNSGsRYbyRwK3xX", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:50:32"}
{"_id": "49YNTaNjfuFoKNXQ4", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, t:Teacher, s:Student | some g:Group | s->g in 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\n}", "derivationOf": "QMMs4vfocEfTj8RZ6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 14:28:10"}
{"_id": "XJ3dfo7PiaWksvXQ2", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some t:Teacher, g:Group | c->t->g in Groups \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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "urtgyb9ea6PGmTCsj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:13:22"}
{"_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": "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": "vtCETZRGmt4SYvj7N", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, g:Class.Groups | t:Teacher | g in c.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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EpAgTrQNFN9ptmJxR", "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-10-27 15:05:27"}
{"_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": "uW9QcnWZdbDTCXgRP", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 c : Class, g : Group, t : Teacher |   \n  \t\tc -> 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": "MQ6j8BWM6GZcGvwfw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:07:19"}
{"_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": "BQsmN4uj8d8A6H6zi", "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  all s : Person.Student | s in Person\n  \n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Sx7MTeZku3cRBXhzn", "msg": "This cannot be a legal relational join where\nleft hand side is this/Person (type = {this/Person})\nright hand side is this/Student (type = {this/Person})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-11-5 00:39:48"}
{"_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": "wGHzK7WzPhcD7myNi", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, p : Person | p -> c in Teaches implies 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": "myah7x8Y8NstuGJ78", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 21:06:40"}
{"_id": "PB8K3ME7o5LYNmJam", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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  some c:Class ,g:Groups ,t:Teacher| all s :Student | c->(s->g) in Groups 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": "pwAt7Ns8FgbwzAa9r", "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-10-27 13:58:21"}
{"_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": "zD6ZPD5oQSWF2CxnN", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | c->t in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SdaHsRoLyKP66wsjP", "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": "2020-10-28 15:32:20"}
{"_id": "z7WRK882LCbLx8CZR", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  always Person in Student implies Person not in Teacher\n  always Person in Teacher implies Person not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  Person always 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": "mudnt5JbWjJ3sroqW", "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": "2020-10-28 14:56:33"}
{"_id": "5vQuuepHXaQRzJJXs", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\tall c : Class, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n  \t\t\tsome t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \tall t : Teacher\n  \t\t| some c : Class, g : Group | c->t->g in Groups\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Wo6eArqWsTHQGMFxT", "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-10-28 20:08:21"}
{"_id": "xtLrYmQyH7iTopdo5", "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\tStudent != 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": "HG2KvZzYrJnMqZzPc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-9-30 09:58:06"}
{"_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": "nmzdwQjmyaHjuQBPR", "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\t(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\t(all t : Teacher, 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "BKf8maW5iRtquXNWF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:05:12"}
{"_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": "bwAkcER3zAzheE2Jf", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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 -> t -> 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": "pYgjHF9e6gn69WA9z", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 22:22:12"}
{"_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": "umaC8KPgo7DtXrnsr", "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 | 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/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "j6tDr6Sawd7ejvhpK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:16:04"}
{"_id": "mf8NCDLzQW8hpqufX", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (some t : Teacher | t->c in Teaches )\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \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 p1, p2 : Person\n  \t\t| 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\tall p1 : Person | p1 in Teacher or\n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher))\n  \t\t\t\n}", "derivationOf": "AwA3a5QuFriMjPjH3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:09:28"}
{"_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": "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": "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": "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": "GHnc9AEqABPoceuiK", "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 {\nno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nnot (some p : Person | p in Student and p 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 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": "pGYvdhPHbaTSsSFz5", "msg": "The name \"teaches\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2021-1-13 21:42:49"}
{"_id": "8euoFSiicCrJtynXS", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher | some y : Teacher | all c : Class | x->c in Teaches implies y->c 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": "52auadHiqAFkPgYJL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:22:39"}
{"_id": "xSXKDMi8Z8krhbDfE", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by 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->c in Teaches and 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": "TGEXFxSfJMZDbR6ZN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:09:08"}
{"_id": "be3B4RCydLexQwAnN", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent != Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ymwT8GZ4J8qzpGMuQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:54:51"}
{"_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": "cH6PzAeMGAEfgQBwM", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gyG47bvL4LBRYEjaG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 21:45:24"}
{"_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": "4ymM6bqgATm6YjM7S", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\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 Teaches 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": "rM8zHCFxJBAsRBSs8", "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-10-28 19:04:35"}
{"_id": "n7cpffXfMjfX2SQqT", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | all t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\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\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 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  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": "iMRMdim75FwvfFMBP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2021-1-12 01:07:17"}
{"_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": "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": "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": "D3JYLd5DJMEXTaesZ", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some c.Groups) implies (some (Teacher & c.~Teaches))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some (t.Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n  all p : Person {\n  \t(some (p.(~Tutors) & Teacher)) or\n  \t(some (p.(~Tutors).(~Tutors) & Teacher)) or\n\t(some (p.(~Tutors).(~Tutors).(~Tutors) & Teacher))\n  }\n}", "derivationOf": "qtp4Kg9FoYRq8MT7S", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:11:54"}
{"_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": "yCtsCL6asNZDkvXBT", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  all p : Person | p in Teacher implies p in Class\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | some p : Person, g : Group, x->p->g\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "u6mXtqrXBxAL3PG5n", "msg": "There are 3 possible tokens that can appear here:\n,  : =", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:25:08"}
{"_id": "W8Ff9pvMvaMcZq5yw", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GJmSKhsJbSu2EuPBo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:10:57"}
{"_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": "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": "usE2KRpPePaJBeLLr", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "b3HrBYMAv4jb4wYCw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:57:11"}
{"_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": "nJ2rStdGLkoCB2HDf", "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 Teacher implies p not in Student) and (p in Student 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 Teacher) and (p not 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": "cb8iGm7Z6uAyHsDWD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 13:25:09"}
{"_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": "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": "DaYoKHj9sFwPLLaDE", "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": "hjfFYBnk4fCggueCf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-22 10:22:52"}
{"_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": "sjCZWy2Qxxfj4A9HL", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DBqNYAdeuEgXudxgR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:17:36"}
{"_id": "4JFm795AxGiMRR8DK", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 | lone c : Class | t->c in Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WoTgKCkkubz2BfaNK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-5 09:00:36"}
{"_id": "82gCBxE4d4ZC6p6AF", "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\tGroup 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": "ZGt86y9G2F5J6Kg5G", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Group}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-6-14 22:45:28"}
{"_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": "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": "JJzgTgx6jpQzHDbc2", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all 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  all t : Teacher | some p : Person, c : Class, 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 p : Person | some t : Teacher, c : Class, g : Group | t->p in Tutors implies t->c in Teaches and c->p->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": "yKgywPnZzLTTiw96D", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:27:56"}
{"_id": "xzHvQmjYucdXk3vcP", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher, g : Group | c -> t -> g in Groups\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall 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\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = 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\tall 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": "dTKM9HggEJaT2MSY7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:43:02"}
{"_id": "6Kjr6CCrGcmKSLuwE", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some t:Teacher,g:Group,p:Person | (p->g in c.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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bdXYDrqGBy2SafdgP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 15:16:16"}
{"_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": "NfxpZuhC2dGpyqhLC", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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 | some g: Group | some c: Class | c->t->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": "YceETJNNAGxijeWPP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:07:14"}
{"_id": "AYacsKLgai8xzyttv", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, g : Group | some c : Class, t : Teacher | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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\tall p : Person | Person in Teacher\n}", "derivationOf": "b3C9TacvfttNmzHB4", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 00:05:29"}
{"_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": "sTtE3mqC6NXHKYaR3", "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": "2020-10-28 21:38:30"}
{"_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": "3en7Fzsws3X5RLq7D", "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 all 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 Teacher and p not in Student)or(p not in Teacher and p in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "o2Z9fjstPWrZQhQy8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:25:34"}
{"_id": "aDkY9rzZrbooqjsHi", "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\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,t2:Teacher | all 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": "vqEWGWYiBkBaqyLPe", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:16:44"}
{"_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": "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": "92GTnLaFA3QAsFg3Z", "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\t(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\t(all 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\t(all 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\t(all s:Student, g:Group, c:Class | some t:Teacher | 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": "wDL3qcySofNSXeDkm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:49:04"}
{"_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": "dwQkgoscALztdHopi", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c:Class, t:Teacher | some g:Group | t->c in Teaches 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": "RZz9Tz5TTbdKgymTs", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 15:50:45"}
{"_id": "5W7obm6Tx4awWy6Lu", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all 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  all t : Teacher | some p : Person, c : Class, 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 p : Person | (some t : Teacher, c : Class, g : Group | t->p in Tutors) implies (t->c in Teaches and c->p->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": "WzTiZEw8JNWgsWgRg", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:20:57"}
{"_id": "pYyP5S7wjWdr88XCm", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all t:Teacher | all s:Student | t->s in Tutors and  s->t not 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": "S9dhnRh3XB25Tgyur", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 13:21:35"}
{"_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": "N5PaE2YegPRTXgjYs", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | some 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 p: Person | all s: Person | p->s in Tutors implies p 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 | some g: Group | all c: Class | 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": "Frqsi5ZsStamxu5iw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:16:49"}
{"_id": "uFzqH6A9MvgMqeTom", "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\tno Teacher\n    \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tno (Student & Teacher)\n\t\n  \t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student and no Teacher and Group.Person not in Student and Group.Person 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": "u6ZMMryRRJK38zjZv", "msg": "This cannot be a legal relational join where\nleft hand side is this/Group (type = {this/Group})\nright hand side is this/Person (type = {this/Person})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 20:07:07"}
{"_id": "DgaFZJdR4RsgDGBAz", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p 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": "z69uSq99tJy2oHJQg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 20:58:03"}
{"_id": "m7kaA749cJhr3P4mk", "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  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->g->p 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": "HEx5SLX83apKtQXfr", "msg": "The name \"p\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:22:14"}
{"_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": "4fDJwZMuAG2g6grJz", "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 & 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": "2020-10-27 19:17:07"}
{"_id": "QDkya3uCYwjTktZ7a", "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  \n  all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n  \n  no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n  \tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \n  all p : Person | p 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": "LtR7BKwvEcKmwpc6C", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:35:46"}
{"_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": "Di4GCvPyqr9R29v4q", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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\tall t: Teacher | some  c: Class | some g: Group | all p: Person |  t->c in Teaches implies c->p->g in Groups and c->t->g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AxKhuq4857RMureDm", "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-10-29 10:31:19"}
{"_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": "rG9fCwFFkttzQzCBb", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | all 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": "5aFmL7cyeAH8LLCR2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:45:01"}
{"_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": "3YMAcosfNATkJK62X", "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 | 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 | 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,t2:Teacher | all 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  \t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n  \tall t:Teacher | some c:Class,g:Group, s:Student |  (c->s->g in Groups) implies ( t->c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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,g:Group | some t:Teacher | (t->s in Tutors) implies ( (t->c in Teaches) 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": "m2YM3nbJsL9BMdGLe", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-4 22:44:53"}
{"_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": "SahYMxH6F8wti3HmZ", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | t in Teaches\n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x 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": "rFtehFZjCSsWXGjwD", "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-10-29 09:34:30"}
{"_id": "DtCozHfucgg3zuZn5", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t : Teacher | some 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  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* 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\n}", "derivationOf": "yathnc8YbG5QyCfsE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:09:15"}
{"_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": "KR6WBb8DNPswiCA6F", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Xj3Twq3Ca9SdBnXZk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:19:37"}
{"_id": "6nSwY4SNtJFpxdNt9", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "H9MJcvDXhtBDC6vkf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:14:41"}
{"_id": "uy36s2jL4BbqCt4L5", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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, g : Group | some t : Teacher |  \n  \t\t(c -> s -> g in Groups and t -> c in Teaches) and (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": "dTdqSs765jzi548B3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:57:18"}
{"_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": "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": "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": "YWTMaMSF8kQz6yMiJ", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 | all t: Teacher | c->t->g\n}\n\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "taMPifSTfvbF2KHWD", "msg": "The name \"g\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:36:37"}
{"_id": "kWKRqH7mzMuARbiWA", "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/* 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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all g : Groups | some t : Teacher | all c : Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DvQ4BRz2xjGdosb5R", "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-10-28 19:00:18"}
{"_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": "5yfvhDfJan6dWp5sy", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 | all  g : Group | \n  \t\t(c -> s -> g in Groups and t -> c in Teaches) and 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": "KrT2fxBKayPwng5Gu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:45:13"}
{"_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": "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": "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": "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": "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": "eEPPJHG7ZEAQaRgkM", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t(some c : Class, t : Teacher | t -> c not in Teaches implies all g : Group, p : Person | c -> p -> g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "BwSGGDsL4oE62wwPK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 02:39:06"}
{"_id": "KDDxhCmcvuYCLEdPi", "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\t(all 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\t(all t : Teacher | all c,u : Class | (t->c in Teaches and t->u in Teaches) implies c=u)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(all c : Class | all t,u : Teacher | (t->c in Teaches and u->c in Teaches) implies t=u) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t(all c : Class | all s : Student | some g : Groups | s->g in Class)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KTudisMAQH54ZMce7", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class->this/Person->this/Group}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 22:57:57"}
{"_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": "GSPAZHqdFPaTCxBbv", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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, t: Teacher | (some c : Class, g : Group |   \n  \t\tc -> 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": "nwNQCBXnr69piBpqh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:05:30"}
{"_id": "9S29LBjyuFszcjvpY", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\t\n  \t(some c : Class, p : Person | p -> c in Teaches and p in Teacher) implies\n\t\t(some c : Class, p : Person | some g : Group | c -> p -> g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "CFLk8HSfzNDTfoHtX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 03:18:56"}
{"_id": "fJvdtZrFBXKRNgvb6", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  lone t : Teacher | some g : Group, p : Person, c : Class | c-> p -> g in Groups implies t->p in Tutors\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "bn3mgRtm2JZWevCrw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:03:12"}
{"_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": "NZmFwyXfMZEZqFfBn", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student 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 x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x 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": "2eDpG7WzCib3do9tb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:47:22"}
{"_id": "ppou8gEzXerQRHhyT", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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 p1 : Person\n  \t\t| p1 in Teachers or\n  \t\t  (some p2 : Person | p2->p1 in Tutors and p2 in Teaches)\n}", "derivationOf": "guSyLmskwvJh4R6nJ", "msg": "The name \"Teachers\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:40:53"}
{"_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": "d533xrAeWqDvRtgBj", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group | some s : Student, 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9yJWFC7DmWQzAohQz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:13:27"}
{"_id": "fka9rNpq4d5gMpqYb", "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 Teacher implies p not in Student) and (p in Student implies p not in 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\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": "4ybG7uAvhmGaHeExy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 13:42:59"}
{"_id": "cDCAzhfdFSeoAyYuL", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, g:Groups | t:Teacher | g in c.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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vtCETZRGmt4SYvj7N", "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-10-27 15:06:00"}
{"_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": "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": "r8jNcTtHYXThq4j3x", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall p:Person | all c:Class | p->c  in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Person | p in Teaches implies p 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": "YPsLzNm4qf6j6Xf4z", "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-10-29 09:33:52"}
{"_id": "mGfR8XmYDBcqhuN9k", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t, p : Person | (c->p->g in Groups and c->t->g in Groups) implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some g : Group | t->g in Teaches\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tJ5pKYiwxdSyAArMF", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:21:08"}
{"_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": "6oJ76mQeKQiegQFBk", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches implies t->c2 not in 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": "Hj4ky8T3xLeQcxjKq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 12:01:11"}
{"_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": "rBKZtSv8L8aHwNt7u", "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  \n  all s : Person | s 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  no (Student & Teacher) \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Student + Teacher) \n  \n  \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "apG44CXnNjqdDLTmZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 19:55:39"}
{"_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": "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": "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": "gtPtmedCXgWioohBh", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, p : Person | p -> c in Teaches implies 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": "w6vWqEBftBbcBNRSy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 20:59:56"}
{"_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": "HfKvgzXiKxiuwDbDJ", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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\tall p1, p2 : Person\n  \t\t| 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\tall p1,p2,p3 : Person\n  \t\t| p1 in Teacher or\n  \t\t| (p2->p1 in Tutors and p2 in Teacher) or\n  \t\t| (p3->p2 in Tutors and p2->p1 Tutors and p3 in Teacher)\n}", "derivationOf": "qdTx7ziMGYRmpG25b", "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": "2020-10-28 22:01:31"}
{"_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": "LDtwHTEQQRr7C6TzJ", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group, p : Person | some t : Teacher | c->p->g in Groups implies t->c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "d533xrAeWqDvRtgBj", "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-10-29 10:15:28"}
{"_id": "bN6dAa3DBmf2CHuxz", "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, 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 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\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 p : Person, c : Class | some g : Group | c->p->g in Groups implies\n  all t : Teacher | t->c in Teaches implies 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": "jCKrFNvSaP3ZrYDwu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:35:19"}
{"_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": "7vxpCCKuakPWdKiF6", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher | some c : Class {\n    t->c in Teaches\n  }\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uMNG5TaC3e7TZRgXb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:43:53"}
{"_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": "M2RbBwS9Nhj6JMiW7", "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 | 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 | 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,t2:Teacher | all 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\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\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": "hLzMWhZnzCK8TnbJM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-4 20:57:38"}
{"_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": "nc9t8snr98E6yMTdK", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student, t : Teacher | 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": "gcB8wJbzWXcG5Nioz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:26:20"}
{"_id": "qHgESs3cwfkHDAJPq", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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\tsome s : Student, g : Group, c : Class, t : Teacher | \n  \t\t(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": "cKT8Czcse3x94sA8e", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:52:43"}
{"_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": "QWhkSaTnnaFFArHSb", "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\tall p:Person | no p in Student and p in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RNwtaZS8kjgDxoGTb", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-22 10:27:09"}
{"_id": "Z7NjhxdHoNGffGgbC", "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 f : Person | f in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall f : Person | f not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall f : Person | f 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\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teaches->c & Teaches) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AyREteDziocojkZNT", "msg": "& 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": "2020-10-29 10:24:46"}
{"_id": "SdaHsRoLyKP66wsjP", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  all c : Class | some t : Teacher | t->c in Teaches\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": "obmmHhkYTxiQiwiYG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 15:31:59"}
{"_id": "ynFbTKeZx6MoE3ZFy", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "FwuNgwFp8GoqZ6WBh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:15:27"}
{"_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": "wSPW9hk7YuYaL5fza", "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 in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "e5kFMHCvBx4pPPqDY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 21:22:50"}
{"_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": "u8Ng6tsruZiSMKRxP", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 | lone c : Class | t->c in Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iPSkRZHhmeSKsq6ve", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-5 09:02:05"}
{"_id": "JRnXMjd66pMqJGrbA", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student | some g:Group,c:Class | c->s->g in Groups implies (all t:Teacher | 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": "RDrykmNnrvvobWmfw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:28:38"}
{"_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": "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": "2GzMeioEAs7QCvQuA", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \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  all 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 c : Class , s : Student | some t : Teacher | some g : Group | \n    ((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": "38Li9ARcTBnCdR3kM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:50:08"}
{"_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": "m6MiQTnXtEXfzYqmB", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone c: 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": "iEnNYFEtLktrGPgGp", "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": "2020-10-27 14:43:34"}
{"_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": "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": "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": "zLAY4fkv3JYFTk9qW", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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 | some g : Group | c->s->g in Groups implies (all t : Person | 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": "tb22tuZET2BiRye4u", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:39:10"}
{"_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": "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": "uw8kXzQ5GT6tc5pKb", "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\t\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": "TkWxj5wtHYM3CxHKq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:02:01"}
{"_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": "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": "LQTfuxJx5eSMCoftw", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c:Class, t:Teacher | some g:Group | t->c in c.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": "M5D9FDxQ5JFXE6ZJ3", "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/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 15:51:31"}
{"_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": "6cS3Qxe7qZEkY5j2f", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student, 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": "7wRCyDwGk3ef6v2tX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:31:42"}
{"_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": "nAbkhCimcsr5iqqcR", "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 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 x : Class | (some p : Person, g : Group | x->p->g in Groups) -> \n(some t : Teacher | t->x in Teaches)\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": "FxXncWJFPoHco4Y5o", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:07: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": "M9fDMtdjuScNGWshL", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, g : Group | some c : Class, t : Teacher | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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\tall p : Person | some p1 : Person | p -> p1 in Tutors implies p1 in Teacher\n}", "derivationOf": "HyDCrtt5BcDYxcvdP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 00:10:17"}
{"_id": "g2oXGdepuhqq7ucG7", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Person | some c : Class, s : Person, g : Group | c->t->g in Groups and t in Teacher\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": "Bq5RAqZGPLpxBiGh5", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:03:30"}
{"_id": "wsG8DfTBmsRTRXPqr", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6PkkN7447qJFZfk7j", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 14:44:25"}
{"_id": "KdeipsvhRvoHiYWr9", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | p1 in Student and p1 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": "qSeSD628rdtNAYrPL", "msg": "The name \"p1\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:07:13"}
{"_id": "42oRffQ6y9EZwuo7W", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some 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": "Nid8GA7bW7RkKmtRg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:55:53"}
{"_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": "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": "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": "suBwdTPYfayGwWQYg", "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 all 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 Teacher implies p not in Student)or(p not in Teacher implies p in Student)\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "f5RfbP7BvvSutrNnS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 18:34:34"}
{"_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": "jWobYHSk7DpgJEyYp", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\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 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": "8xgLHiB9CaiABRZ8J", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 22:41:21"}
{"_id": "rSLASFiKsckjWGNgY", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  all p : Person | p in Teacher implies p in Class\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yCtsCL6asNZDkvXBT", "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-10-29 09:25:14"}
{"_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": "pzh25E5u8tgtC3NtR", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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, t: Teacher | (some c : Class, g : Group |   \n  \t\tc -> 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": "5GwW9hsxnNAfPXdqC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:06:17"}
{"_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": "k7yYZpNrDdpjQaTrC", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t : Teacher | some 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  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SufSzbAGXhB9eJsqP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:11:41"}
{"_id": "ceGRz7XrZyvbLSm36", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "S6eX3pRHZZ2xeuitW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:15:20"}
{"_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": "PQoQJT9BYcoKQJ4D3", "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-9-30 09:57:32"}
{"_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": "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": "4DT6HAQ9nQnCLhbWM", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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  lone t: Teacher | some g: Group | some c: Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t: Teacher | all s: Student | t.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": "DfJHwA5qLg8qnrw4m", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:50:39"}
{"_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": "42tzacdHdCL9CWEYM", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | all  c: Class | some g: Group | c->p->g in Groups implies p in Teacher and p->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RSTgdgGAKFzFcAzTZ", "msg": "The name \"p\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:23:20"}
{"_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": "8iPt86KPvyLvmHjSQ", "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 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\nall p1,p2,p3:Person | (p1 in Teacher implies (p2 and p3 in  Student) )\n}", "derivationOf": "aMweuf6pf3nuxLfmG", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:46:44"}
{"_id": "j59xoQ4nsnqrFetRB", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Cf9jRLtyqNc9PZfm4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:45:15"}
{"_id": "ocEAHbygvoBHQu2m4", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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\tall p1, p2 : Person\n  \t\t| 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\n  \t\t| t->c in Teaches and 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": "vZ5vZAcMXzFJRpbFp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 21:18:04"}
{"_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": "w42pfwA9Qf7zqxzze", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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": "tc7bR92d4mHRpvoxB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 15:33:44"}
{"_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": "Eh92PC85RJJ3PGuo2", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student | some g:Group,c:Class | c->s->g in Groups implies (all t:Teacher | 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": "GWxF99Yb4We8mr3CE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:28:27"}
{"_id": "w7Rmcw8GSSExGbTAf", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Person | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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, g : Group | some t : Person | c->s->g in Groups and t->c in Teaches and t in Teacher and s in Student 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": "3PeGbdqqXSZC6gk5M", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:15:42"}
{"_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": "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": "2nbRhq8L97qTbDkg8", "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\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tno (Student & Teacher)\n\t\n  \t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student and no 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": "uFzqH6A9MvgMqeTom", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 20:08:10"}
{"_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": "Ks7THEbhJHyGZpnjC", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 | all c:Class | some t:Teacher | t->c in Teaches and 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/* all p1,p2,p3:Person | \n}", "derivationOf": "hDdwxyQeoAtXEeYrZ", "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-10-29 10:23:36"}
{"_id": "sFi8xBDqwJKvEhbsG", "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 x : Class | (some p : Person, g : Group x->p->g in Groups) -> ( some t : Teacher | t->x in Teaches)\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": "PRFDKFhQMHtibyQTp", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:16:37"}
{"_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": "SEAvDMY3y3jaeB35L", "cmd_i": 1, "code": "sig Worker {\n}\n\nvar sig Prepared in Worker {\n}\n\nvar sig Committed in Prepared {\n}\n\nvar sig Aborted in Worker {\n}\n\nfact init { \n\tno Prepared and no Aborted\n}\n\npred nop {\n\tPrepared'= Prepared\n\tCommitted'= Committed\n\tAborted'= Aborted\n}\n\npred finish[w : Worker] {\n\tw not in Prepared\n\tPrepared'= Prepared + w\n\tCommitted'= Committed\n\tAborted'= Aborted\n}\n\npred abort[w : Worker] {\n\tw not in Aborted w in Prepared implies some Aborted\n\tPrepared'= Prepared - w\n\tCommitted'= Committed\n\tAborted'= Aborted + w\n}\n\npred commit[w : Worker] {\n\tw in Prepared-Committed\n\tno Aborted\n\tPrepared'= Prepared\n\tCommitted'= Committed + w\n\tAborted'= Aborted\n}\n\nfact transitions {\n\talways (\n\t\tsome w : Worker | finish[w] or commit[w] or abort[w] or nop\n\t)\n}\n\nrun {} for 1", "derivationOf": "YH3ANm7Y5Qe5dSYem", "msg": "The name \"Person\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-22 09:04:16"}
{"_id": "nnWgh7aocsponF7rQ", "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 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\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": "BqRXNnDjRvxMKicHk", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:02:52"}
{"_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": "Li67k43owd9Qwqxzv", "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  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": "yFS8XdM4Gbo6MkTkQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-5 00:45:38"}
{"_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": "9TkRhmhtXrRdzzTry", "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/* 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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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  some c : Class | some g : Groups | all t : Teacher | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all s : Student, c : Class, g : Group, t : Teacher | (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": "ofQ86egGWRojd7vKt", "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-10-29 09:55:25"}
{"_id": "fvBRDeg3oNc6G4JED", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KR6WBb8DNPswiCA6F", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:20:29"}
{"_id": "7WbKHvyXxxXsBiiza", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group | some p : Person | c->p->g in Groups implies (p->c in Teaches and p in Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all s : Student, c : Class, g : Group | all t : Teacher | (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": "tDgAdzLGiWo9yJpfr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:44:40"}
{"_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": "CF5EghxNYiqEbxiNq", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\n\tall x : Person | x in Student or x 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": "FW6s5zSKpyZY3RsH2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:09:45"}
{"_id": "FQxpwkbhSmfe7K37m", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 p: Person | some c: Class | some g: Group | c->p->g in Groups implies p in Teacher and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "puxwEkSY9pJhBC6fM", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:22:31"}
{"_id": "EaX3Nfyzx5zPFoipn", "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  all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n  \n  no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n  \tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \n  all p : Person | p in (Student + Teacher)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n  some c : Class ,t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n  all t : Teacher | (#t.Teaches)>0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  \n  all t : Teacher | (#t.Teaches)<2\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  \n  all c : Class | #(Teacher.Teaches)<2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DKaSnNGRYYqt89ZcW", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:02:36"}
{"_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": "fFidosR6j8ZihnicH", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Groups | 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": "usE2KRpPePaJBeLLr", "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-10-28 18:59:54"}
{"_id": "dtdmsNHvNyuaPgHna", "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 all 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 Teacher and p not in Student)or(p not in Teacher and p in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YTHH782Wh3FBdhC9B", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 17:49:24"}
{"_id": "HWRJXiDDAF39dJWRQ", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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    all s,t:Person | all c:Class | 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\t\n}", "derivationOf": "LBFbHTFtyLoCKDre3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:48:02"}
{"_id": "qdTx7ziMGYRmpG25b", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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\tall p1, p2 : Person\n  \t\t| 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, g : Group, t : Teacher\n  \t\t| 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": "YKy8LYsKdapW3xqbn", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 21:31:39"}
{"_id": "6i7RNhdPEeNjtarcT", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:14:30"}
{"_id": "t3tb8Gn4EeSndmrXG", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Person | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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, g : Group | some t : Person | c->s->g in Groups and t->c in Teaches and t in Teacher and s in Student 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": "STQx8W4fBwY53Tatc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:15:04"}
{"_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": "puxwEkSY9pJhBC6fM", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 p: Person | some c: Class | some 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\tall p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YCFxWdW598SnFizeA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:22:08"}
{"_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": "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": "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": "fyfrdbD3YdLKfxknG", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p: Person {\n  (p in Teacher implies p not in Student)or(p not in Teacher implies p in Student)}\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "suBwdTPYfayGwWQYg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 18:35:12"}
{"_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": "essEkwo3WsMKRBKod", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "HrKp5tywokg4vS8mk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:04:19"}
{"_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": "RiqzZTvWoCtJ9oQqj", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | some g: Group | all p: Student |  t->c in Teaches implies c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oYjhL4hBmbZAHe3h4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:28:34"}
{"_id": "ajHpNhYq9LfqQeJfm", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x 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 x : Teacher | some y : Class | x -> y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  \tall c : Class | all t, x : Teacher | t -> c in Teaches and x -> c in Teaches implies t = x\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, t : Student | some g : Group | c -> t -> 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 : Teacher | c -> p -> g in Groups\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall 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": "QTZzzkMhS5ou4T5kp", "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-10-29 09:53:26"}
{"_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": "F6Q2YpNGJds478AZp", "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": "ZnRLwYpyyAwngSrfF", "msg": "The name \"Teachers\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 20:46:16"}
{"_id": "47iwqetyZQwSvkcCX", "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 Teacher implies p not in Student) and (p in Student implies p not in 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\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": "B7hkAooz5wF8Lukp5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 13:49:10"}
{"_id": "yEb8Fa5EpMHQw3Syd", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches implies (some g:Group | all p:Person | c->(p->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": "TiD7ymTAo9gGoyMey", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:59:16"}
{"_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": "98dYRRn7nwrAXP6Jw", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, g : Group | some c : Class, t : Teacher | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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\tall p : Person | p in Teacher\n}", "derivationOf": "AYacsKLgai8xzyttv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 00:05:35"}
{"_id": "W58nCGYTxwcdRLy38", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | one 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": "bEy7ckvqnd8GYeocF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2021-1-12 00:59:06"}
{"_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": "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": "odnn6bdM42tHwZKJk", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\n  \t\t| some g : Group\n  \t\t\t| c->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\n  \t\t| c->p->g in Groups implies\n  \t\t\tsome 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\tall p : Person\n  \t\t| (p in Teacher implies all p2 : Person | p2->p not in Tutors) and\n  \t\t  (p in Student implies all p2 : Person | p->p2 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": "Diw93Z9bLtX7Dhf2p", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 20:22:45"}
{"_id": "KJxtk5vdxFzc8A559", "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  some p: Person | p in Person.Teaches\n}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\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": "2020-10-27 13:59:48"}
{"_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": "k4gz2Rugso2Bsrg2k", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x 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 x : Teacher | some y : Class | x -> y 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\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | some t, x : Teacher | t -> c in Teaches and x -> c in Teaches implies t = x\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* 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 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": "Cpzm6cdCpNi4Nh4Z9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:48:46"}
{"_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": "LRNurngCPufXdKRgS", "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\n/* Some persons are 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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall t: Teacher | t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\t\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\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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p in Teacher and s 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": "DNyRHWPKTzN4PYYkA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 12:47:51"}
{"_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": "NBYXMimgWSSnYSkKS", "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\t(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\t(all t : Teacher | some c : Class | t->c in Teaches implies (some s:Person, g:Group | c->s->g in Groups))\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "xXLGPin4Z8CTuvGZR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:24:16"}
{"_id": "NoxarSabTzFtNBmRT", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  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/* 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": "MbZXCGFRkXyKeetRk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:37:27"}
{"_id": "4ra9nFHx8nEywjygu", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 | lone c : Class | t->c in Teaches\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EcW7HDqhfLxQJxrRM", "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-11-5 09:00:11"}
{"_id": "mX2RQAMAm2BdQmReF", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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, t : Teacher | some g : Group, c : Class | \n  \t\t(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": "ursqhXgurBpkdPocw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:48:43"}
{"_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": "DNyRHWPKTzN4PYYkA", "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\n/* Some persons are 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\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\t\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\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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p in Teacher and s 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": "Jv2HJX4yFjH5v9t8w", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 12:47:42"}
{"_id": "vzPzKWMPif3jXwAqZ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall 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 Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | some 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\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sMykGM7Tk8bStBh56", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:54:01"}
{"_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": "KLtvEpzZXgMEkncfT", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "PXNYNyEGCLfv5CiF9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:30:33"}
{"_id": "2fZT9Hev5jHXxJJJj", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (some t : Teacher | t->c in Teaches )\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \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 p1, p2 : Person\n  \t\t| 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\tall p1 : Person | \n  \t\t(some p2 : Person | (p2->p1 in Tutors and p2 in Teacher) or\n\t\t\tsome p3 : Person | (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher)\n\t\t)\n  \t\t\t\n}", "derivationOf": "RPEhdQw7QgnpYqSJC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:11:41"}
{"_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": "Mix8brNxL2e7G5TS9", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some t : Teacher | all g : Group | 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": "rYbsFj7SGMBAKA79o", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 19:02:15"}
{"_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": "YQSsDyRnoz7Ps6T2k", "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\t(all c : Class | all s : Student | some g : Group | c->(s->g) in Class implies 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}", "derivationOf": "CbzpoAcnShLh3b5Qe", "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": "2020-10-29 09:09:02"}
{"_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": "2ozYzQt4SGyqrn9EX", "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\t(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\t(all 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\t(all 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\t(some s:Student, g:Group, c:Class | some t:Teacher | 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": "kpH23aHEojCfo3c4P", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:00:15"}
{"_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": "hcY8F2Q3cDe28TwTM", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, g: Group, p: Person, 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\tall t: Teacher | some c: Class, g: Group, 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\tall p,pp: Person | p->pp in Tutors implies p in Teacher and pp in 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\n}", "derivationOf": "dbGcfT33N2DLAqAuP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:13:50"}
{"_id": "AKJPb9r7XBkc2cBJD", "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  all x,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x not in Teacher\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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all 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": "Yya3EGt2rk5s6TpEc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:07:35"}
{"_id": "KS3p7CJwW85wH6D4G", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 c:Class | some t:Teacher | t->c in Teaches implies s->t 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": "nrYsmeRFxNT7ZL3hR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:04:48"}
{"_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": "7GCdHyM7Eqj7irwxt", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 c:Class | some t:Teacher | 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\t\n}", "derivationOf": "KrfDNvQREz4rEFwyb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:30:42"}
{"_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": "P78JkpeDofRSExGRq", "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  all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n  \n  no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n  \tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \n  all p : Person | p in (Student + Teacher)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n  some c : Class ,t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n  all t : Teacher | (#t.Teaches)>0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  \n  all t : Teacher | (#t.Teaches)<2\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NWqikXFmYhYDBSqMt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:00:34"}
{"_id": "natGJj2MgJurmgrt4", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Person | some c : Class, s : Person, g : Group | c->s->g in Groups and t->c in Teaches and t in Teacher and s in Student\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": "ff6AAsjKQfmy7veze", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:06:30"}
{"_id": "4ukcByxCedciZHxg4", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  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": "YqdzwXxStwzTq2wPi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:50:10"}
{"_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": "dNBqjuM6BE2S6tyjJ", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some c.Groups) implies (some (Teacher & c.~Teaches))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some (t.Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n  all p : Person {\n  \t(some (p.(~Tutors) & Teacher)) or\n  \t(some (p.(~Tutors).(~Tutors) & Teacher)) or\n\t(some (p.(~Tutors).(~Tutors).(~Tutors) & Teacher))\n  }\n}", "derivationOf": "aBhTGkrncdA34ssok", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:11:42"}
{"_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": "KvLKomMqbLwjPA33X", "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\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: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\tall t1,t2:Teacher | all 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": "zqcrgF4eLWN2rBLpP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:14:19"}
{"_id": "DDaKwL4QqSuPTP6h5", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tsome g: Groups | lone t: Teacher | t.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PdRRj8xyD4vKpuwNP", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none->none}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:51:50"}
{"_id": "4dMf2bw7eqhoD58K3", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, g: Group, p: Person, 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\tall t: Teacher | some c: Class, g: Group, 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\tall p,pp: Person | p->pp in Tutors implies p in Teacher and pp in 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 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": "eRX66NGLCEaeKqE65", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:20:32"}
{"_id": "qQqXoEEY5HiecTdR5", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hPa3dT7DfqK7AQEAT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:43:24"}
{"_id": "3raL7ySq4hQPQbuW6", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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, g : Group | some t : Person | c->s->g in Groups and t->c in Teaches and t in Teacher 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": "8RMsNXtLnuqwLpnG8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:21:36"}
{"_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": "rnDkJ7XFSxiNdGRWJ", "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\tTeacher in iden\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\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": "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": "2020-6-14 22:44:04"}
{"_id": "qMtpk3wmGxmhyLyGR", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some c.Groups) implies (some (Teacher & c.~Teaches))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some (t.Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n  all p : Person {\n  \t(some (p.(~Tutors) & Teacher)) or\n  \t(some (p.(~Tutors).(~Tutors) & Teacher)) or\n\t(some (p.(~Tutors).(~Tutors).(~Tutors) & Teacher))\n  }\n}", "derivationOf": "rer7qvFg6ND3yKW7a", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:11:48"}
{"_id": "datFiD8JeAdLWvZte", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \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": "SZ4FADhSjbEPmMMCs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 21:22:47"}
{"_id": "jkunoZWuEN3baBqq6", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\tall c : Class, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n  \t\t\tsome t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \tall t : Teacher\n  \t\t| (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": "5vQuuepHXaQRzJJXs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 20:08:50"}
{"_id": "KjHuMpw68cGuKEpsD", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AnLjqSDQMsw8t9Sd7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:03:54"}
{"_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": "khcBF6y6qmYYWr26b", "cmd_i": 13, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tsome s :Student | some c:class | some g:Group | c->s->g in Groups and (some t:Teacher t->c) implies t->s in Tutors\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "x5LYTLHS6WxaTcsCK", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:53:44"}
{"_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": "TbXPe2YbPj34y8Y3S", "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  \n  all s : Person | s 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  no (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": "v7z5hvXww7Sedusav", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 19:46:25"}
{"_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": "o2Z9fjstPWrZQhQy8", "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 all 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 Teacher and p not in Student)or(p not in Teacher and p in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "z2jLtRGRAfts5dMuq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 18:25:31"}
{"_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": "tb22tuZET2BiRye4u", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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 | some g : Group | c->s->g in Groups implies (all t : Person | 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": "guQ6fpkb5eAN68hXB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:38:56"}
{"_id": "JT35gDAcWvMM5EMgh", "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 | 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 | 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,t2:Teacher | all 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  \t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n  \tall t:Teacher | some c:Class,g:Group, s:Student | ( t->c in Teaches) implies (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\tall s:Student,c:Class,g:Group | some t:Teacher | (t->s in Tutors) implies ( (t->c in Teaches) 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": "uCfcasMzgF86uAzMF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-4 22:26:44"}
{"_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": "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": "yFS8XdM4Gbo6MkTkQ", "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  all s : Person.Student | s\n  \n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BQsmN4uj8d8A6H6zi", "msg": "This cannot be a legal relational join where\nleft hand side is this/Person (type = {this/Person})\nright hand side is this/Student (type = {this/Person})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-11-5 00:40:03"}
{"_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": "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": "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": "Jps2mgqE8j2ErbmfT", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c:Class, t:Teacher | some g:Group | c->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": "qD2wTxt5iJxzZQBXi", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 16:05:35"}
{"_id": "kPJpeL6hqpDfQdM96", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some c : Class | t->c in Teaches and (some g : Group, s : Person | c->s->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 | (some g : Group | c->s->g in Groups) implies (all t : Person | 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": "zLAY4fkv3JYFTk9qW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:39:15"}
{"_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": "wNFcsx8xWq7F6PLzX", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 | all  g : Group | \n  \t\t(c -> t -> g in Groups and t -> c in Teaches) and 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": "SJsxYrvHBYxsXtJop", "msg": "The name \"class\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:44:13"}
{"_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": "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": "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": "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": "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": "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": "xSjn5fkS586YrFYPA", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8SHHduoiYhZayjHM4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:13:33"}
{"_id": "vfo5znAmquDHz3pcq", "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  \n  all s : Person | s 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  all p : Person | no ( p in Student & p 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": "qXbXMCxZTCkfKuRGd", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 19:35:55"}
{"_id": "jFhF9PiiPZsM7epMJ", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  all t : Teacher | all 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": "abpCQqs7SSTMABAmH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:15:00"}
{"_id": "8NbX6ktBiBKgobsZ5", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c:Class, t:Teacher | some g:Group | c->g in c.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": "F7nx6uqtA2aB88MYJ", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Group}\nRight type = {this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 16:04:00"}
{"_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": "cwkoSmZL48XcqyF7k", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8deqTSNJiHhSDtgax", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:03:59"}
{"_id": "QGoQ8NKKwzPtDFYSG", "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\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tno (Student & Teacher)\n\t\n  \t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person & Student) and no (Person & Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kPZ3yRWT74sZNxFK9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 20:03:01"}
{"_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": "XnGA4sZK9tBBQY3f3", "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\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\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": "5vnkKadHwtY9Fn8Ln", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:05:41"}
{"_id": "2xtQApoGfLYW9QL9Q", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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  some c:Class ,g:Groups ,t:Teacher| all s :Student | (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\n}", "derivationOf": "b6rjw2DcrzCoETLW8", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:12:41"}
{"_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": "pWDssjFwW9ooeiF7M", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, t : Teacher | t -> c in Teaches implies all g : Group | c -> p -> g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "PcfCSoKMzDBapvsWH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 02:30:44"}
{"_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": "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": "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": "7u8gWY8nwbFw8ASX3", "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 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 | 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,t2:Teacher | all 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  \t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n   \n\tall t:Teacher | some g:Group, s:Student | \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,c:Class,g:Group | some t:Teacher | (t->s in Tutors) implies ( t->c in Teaches and\n      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": "YhXphesRP9hGWmMgW", "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": "2020-11-4 21:39:13"}
{"_id": "kPZ3yRWT74sZNxFK9", "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\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tno (Student & Teacher)\n\t\n  \t\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 t : Teacher | some (t.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RCs5LcmBRch7YNnWK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 19:51:56"}
{"_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": "9ur42LFqqRXRi2a8S", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 (Person-Student-Teacher)\n}\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": "46NDCWcn96iTdDsz9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:37:35"}
{"_id": "7JXgqg35X9nbuYNx3", "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\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": "ntw8eb8pzNNH5LdP9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:03:09"}
{"_id": "RmnPfqqufiBkvX3v8", "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\t(all 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": "JRhJqeQe8ZniHRHrt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:33:35"}
{"_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": "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": "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": "3utQzMDQPmtTJjKJw", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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, 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\n  \t\t| some g : Group\n  \t\t\t| c->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\n  \t\t| c->p->g in Groups implies\n  \t\t\tsome t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher\n  \t| 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 p1, p2 : Person\n  \t\t| 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": "myfM8tejPeRiMPCRZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 20:43:09"}
{"_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": "MajuW8ePCNYWHdmCP", "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": "hYZ77oo6ApgfXWgj3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:23:21"}
{"_id": "q6tffriHgQfEEtMHL", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Person | some c : Class, s : Person, g : Group | c->s->g in Groups and t->c in Teaches and t in Teacher and s in Student\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": "X49BHZPSCsGxAG5zD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:04:57"}
{"_id": "ZPrz5KjNiFmA4Nezv", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tsome t: Teacher | all s :Student|some g:Group |some c:Class | c->(t->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": "Xcob8sd8yAdB6YAqu", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 13:14: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": "3gZmd4sRC8Pg9btfk", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  some x : Class | (some p: Person g : Group | x->p->g in Groups) implies (lone t : Teacher | t->x in Teaches)\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "YHeb3DQYJEAwrM5Ay", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:53:44"}
{"_id": "5SR8Q2ArgAwjKQ9BP", "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 => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tsnP9ZztEzshXfgZx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-30 21:39:56"}
{"_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": "8deqTSNJiHhSDtgax", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\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,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KjHuMpw68cGuKEpsD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:03:56"}
{"_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": "a4rFnBAWafjqhgkYG", "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\t(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\t(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\t(all t : Teacher | some c : Class | t->c in Class implies some g : Group, p : Person | 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\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3PcBoDY3j5mckAsQ7", "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": "2020-10-29 09:27:00"}
{"_id": "85CpsBjKFuhZMnnhx", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t: Teacher | some g : Group| t->g in Tutors\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": "kA2HhaA3a2gwZT2Zy", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:20:12"}
{"_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": "HxpLfh6ZXb48F6u3u", "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 p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, p1, p2 : Person {\n    (p1 in Teacher and p1->c Teaches)\n    implies\n    (p1->p2 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": "26CmABvo6rns5uWFf", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:03:06"}
{"_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": "MqeBes54MY2Jac9SN", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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  some 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\tall p: Person | all s: Student | p->s 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": "yr9zZurZAd8tduJuo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:00:51"}
{"_id": "2tKk2jApChAdcy5R9", "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  \n  all p : Person | p in Student\n  \n}\n\n/* There are no teachers. */\npred inv2 {\n  \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  all p : Person | p not in Teacher and p not in Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4XgFFMf64pkRJHWFQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-5 00:48:11"}
{"_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": "YGpwFDi4vhZSryYmG", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all 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\t(some 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\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": "X9YLzRb4Y6BFCEJNa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:45:00"}
{"_id": "bk6ARBuaXGHYWLxrm", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 | 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": "tPt5T9d28ARqW3gRP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 14:34:02"}
{"_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": "W9G4Q55XJ2ZnMPDM5", "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": "2020-10-28 17:07:24"}
{"_id": "iEnNYFEtLktrGPgGp", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone c: 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": "KWY7oPwiNnhxxTQ3j", "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": "2020-10-27 14:43:30"}
{"_id": "b7FQprqM4Xr6ZA2xW", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t, p : Person | (c->p->g in Groups and c->t->g in Groups) implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */ \npred inv12 {\n  all t : Teacher, c : Class | some g : Group, p : Person | p in Group implies t->c in Teaches\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tQQoHbeMTMMvzv4k4", "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": "2020-10-29 10:29:33"}
{"_id": "McF7YMmwhRzdEiPyu", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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  lone t: Teacher | some g: Group | some c: Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t: Teacher | all s: Student | t->s and not s->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": "4DT6HAQ9nQnCLhbWM", "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": "2020-10-29 09:51:22"}
{"_id": "o4CacviNWTfbCpaGK", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bxPio7AYhchP438kd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-31 12:54:19"}
{"_id": "BNhDR63xnRphTun2e", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t: Teacher| (some x:Class | t->x in Teachers) implies some g:Group | t->g in Tutors \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\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": "FeWKSHGdyZgJgvCDH", "msg": "The name \"Teachers\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:28:22"}
{"_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": "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": "Qog4g4Mh3fYhepfPQ", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Groups, p : Person | c->p->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": "QaMk5e27vb86QBT64", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Person->this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:17:57"}
{"_id": "hLzMWhZnzCK8TnbJM", "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 | 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 | 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,t2:Teacher | all 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\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\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": "Nyz9Kstz44uHWACfd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-4 20:57:05"}
{"_id": "hANMQh8cmZrmpNHPy", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n  all ps : Person, t :  Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jaLKJ4r3CWX7LmrMd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 13:08:43"}
{"_id": "7KSTCELwEMCrKctB9", "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  \n  all s : Person | s 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  no (Student & Teacher) \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n  no (Student + Teacher)\n  \n  \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XSBkX2cDXv36o7cKi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 19:54:20"}
{"_id": "cpe3GnGE5HgRzHrkS", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome x : Teacher | all c : Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->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": "AribgWww4v6Sd9hzf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:16:24"}
{"_id": "wJPszkuiHqi8xvcWd", "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 Teacher implies p not in Student) and (p in Student implies p not in 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\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": "fka9rNpq4d5gMpqYb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 13:43:51"}
{"_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": "hod9fE4gnjiaXpagv", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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": "3krqvQT3SRoq26A3e", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:55:11"}
{"_id": "SuSaPz335JNiMPer7", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 { \n  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": "yaiswyMwS9r7NaLCR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:59:39"}
{"_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": "HNbYxc6HQfLYPiYma", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches implies (some g:Group | all p:Person | 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": "QcCShFxG5pAoxskFj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:57:36"}
{"_id": "2aRirzfGgryofwmaR", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all p1, p2 : Person | some c : Class | some g : Group | p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->c in Teaches and p2->g in c.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 p1,p2 : Person , c : Class| p1->p2 in Tutors implies p1 in Teacher and p2 in Student and p1->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": "BaWJJ6Fb7SXycDyyv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:16:52"}
{"_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": "WCe6Mg2k9ivNMBbyC", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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, g : Group | some t : teacher | \n  \t\tc -> t -> 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": "XF22yafQrD5a54oCD", "msg": "The name \"teacher\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:38:24"}
{"_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": "pdNndiKh8gcMbt9mp", "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\tnot (all p : Person | p in Student or and 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": "oEpAjcM3RgCw9d38Z", "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": "2020-10-28 19:42:21"}
{"_id": "ho7ATgYrBwTnWMguB", "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  all s : Student | s in Person\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NByyZREGdLEHt54up", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-5 00:35:04"}
{"_id": "uaLFzyRKKif9tZdwo", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | p in Teacher and p.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": "vhLn5hkFsoQ39taYQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 15:14:12"}
{"_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": "uv8C2mLmvu9ZrxBbs", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 g : Group, t : Teacher |  c -> s -> g in Groups  implies 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": "nus78WpHarM69eect", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:14:45"}
{"_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": "kKzxgqko3PRfgKsJR", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher | all c : Class | all d : Class | x->c in Teaches implies x->d 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": "5KuYb4chYaPERJevh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:24:55"}
{"_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": "bfTWyo7LmLPmhfYvk", "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 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": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:30:38"}
{"_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": "Gei6du7dqFD8qnvkJ", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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": "kzdrr6s6A73Wwgy3g", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 21:01:58"}
{"_id": "w2zCrwzA5DuzJ4jou", "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} th\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\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 | 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 | 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,t2:Teacher | all 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 s:Student| some g:Group | (c->s->g in Groups) implies (some t:Teacher | t->c in Teaches)\n  \t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\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\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": "YsRbiqQcyYqr6WaLT", "msg": "There are 5 possible tokens that can appear here:\nenum fun let open pred", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-11-4 21:09:19"}
{"_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": "PN89CWiotB5gECxF8", "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 | 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 | 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,t2:Teacher | all 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\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\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": "M2RbBwS9Nhj6JMiW7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-4 20:57:58"}
{"_id": "3gJtg4ypqZWR2n5yx", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PLbt7NXWoQ9tmqYxE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 20:56:21"}
{"_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": "kaXoZ3ww6EHdGvKbM", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (p not in Student and p not 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": "pY9GAA5C6XeXivEso", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 19:50:35"}
{"_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": "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": "G4umFW9nHyubNirtg", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GiKfPf7A5wsQHcQzz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:27:54"}
{"_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": "kA2HhaA3a2gwZT2Zy", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | t->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all x,y:Class, t:Teacher | 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 x:Class, t,t1:Teacher | t->x in Teaches and t1->x in Teaches implies t=t1\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t: Teacher | some g : Group| t->g in Tutors\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": "terhLQtq9RijK7YgW", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:20:01"}
{"_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": "ndxRLs9ZQ47MABt6N", "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 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2: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": "wsvqCCjn3tGxtkhnZ", "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": "2020-10-27 12:09:18"}
{"_id": "ymbtkdhKyeZv29GsE", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \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": "dEoe4PYGehnPQvGnT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 11:26:47"}
{"_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": "waCEJh7SisHMZRMAR", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some g:Group |some 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\t\n  \tall t:Teacher,c:Class | some g:Group | c->t->g in Groups implies t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n\tall s:Student,t:Teacher | some g:Group,c:Class | 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": "FpmfRaLJ7eHwED2Yb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:39:23"}
{"_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": "ruzttQfrakWEgJ8Tv", "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\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\tno Student and no 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": "HyBa7vWaii8HNpucr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 19:35:33"}
{"_id": "9Zr36nBekJGbCYLaj", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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": "wrRDWCW8ufhPHavQz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 14:37:12"}
{"_id": "e4aZFy6NW3qtL2iRp", "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 p : Person, c : Class, g : Group | p in Teacher implies c -> p -> g in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall t : Teacher, c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups implies 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": "TMwoGgzfQ9tcFokeG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 14:14:42"}
{"_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": "fLh7fhwcXwYo3uWhk", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Groups| all p : Person | c->p->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": "eFXuR4HjqFEkcyFvq", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Person->this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:18:50"}
{"_id": "L6YAkCLMHBpn5TPF4", "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 all 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 Teacher and p not in Student)or(p not in Teacher and p in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zWwJuSS2fdpiGLtaL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 17:49:29"}
{"_id": "gMiyBnbzA7XEZ553G", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\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\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "YXYQY7SWExEjgSkYG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:17:22"}
{"_id": "dfqKT86a929qEgD3F", "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 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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   all t:Teacher | all c1,c2:Class | t->c1 in Teaches  implies t->c2 not in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2: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": "aQZT54xKjxHhbuiQS", "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": "2020-10-27 12:06:58"}
{"_id": "5Khvsdq8jZyKKYjPj", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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": "PD2eNgCX4efYYZqkp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 21:43:48"}
{"_id": "hqJ6W8ZLNSja2Ewi3", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, p : Person | p -> c in Teaches implies 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": "CKRkct6MCPADorHNP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 21:03:14"}
{"_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": "uC4te8zZeJuvFALHo", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tsome g: Groups | lone t: Teacher | 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": "DDaKwL4QqSuPTP6h5", "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": "2020-10-27 14:52:14"}
{"_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": "cifD3vkxm948pTxHL", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, g: Group, p: Person, 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\tall t: Teacher | some c: Class, g: Group, 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": "DTxv3N78kx45ofHgC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:10:21"}
{"_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": "pRjCqzqg6ExXrxAoZ", "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 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class |some t:Teacher |some g:Groups|  no c implies no (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": "PzkRf6jRbo75hxGkF", "msg": "This expression failed to be typechecked line 105, column 62, filename=/tmp/alloy_heredoc7603071972271309783.als", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 12:44:14"}
{"_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": "epLkf3Xqw4HZqvWaA", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by 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->c in Teaches and 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": "meTeqxfTAkxmR9miJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:19:27"}
{"_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": "T7iK6Q4sgTqnAryLb", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, g : Group, p : Person, 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\tall t: Teacher | some c: Class, g: Group, p : Person | c->p->g in Groups and t -> c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall a, b : Person | a -> b in Tutors implies a in Teacher and b in 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": "pLJG34zMf8TjihNiY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:11:14"}
{"_id": "TcC9TYhvXX7ZSE7fq", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group| some p1, p2 : Person | c->p1->g in Groups implies p2->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all p : Person | some c : Class, g : Group | c->p->g in Groups and p in Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ctvqux7AnoCeujahk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:19:31"}
{"_id": "NZkXhTDkEdff2xBNN", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x 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 x : Teacher | some y : Class | x -> y 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\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t, x : Teacher | t -> c in Teaches and x -> c in Teaches implies t = x\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* 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 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": "MfzYjP8qkhtZGLAif", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:50:16"}
{"_id": "wMEXeSPypGqng3bGo", "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\t(some 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": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:31:35"}
{"_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": "QcCShFxG5pAoxskFj", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches implies (some g:Group | all p:Person | 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": "KJPbfkho6MHmgg3Jj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:57:22"}
{"_id": "Z9WmXbDY3dvNTmHqu", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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 and 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": "e3Wq5AM9DQwQAK5Pv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 22:22:32"}
{"_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": "BLxgtgSqLxqM6CuPx", "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\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 | 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,t2:Teacher | all 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\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 c: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": "YH3ANm7Y5Qe5dSYem", "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": "2020-11-4 20:55:10"}
{"_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": "N9XSWnwjY5ZsLv2sM", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group, p : Person | 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  all p : Person | some c : Class, g : Group | c->p->g in Groups and p in Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fHE7B5NTQNz6Ngm34", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:18:47"}
{"_id": "nwNQCBXnr69piBpqh", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 p : Person, t: Teacher | (some c : Class, g : Group |   \n  \t\tc -> p -> g in Groups and t -> c in Teaches) implies (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": "7YRjdapWGDGshJpyi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:05:12"}
{"_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": "jqd5YgjPAArMgSSCc", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some c:Class,s:Student,g:Group | t->c in Teaches and s->g in c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Rg92fmDdnTTa9PRc6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:05:58"}
{"_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": "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": "EWwYFcAwsM8cDbGt6", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, p1, p2 : Person | (p1 in Teacher and p1->c in Teaches) implies (p1->p2 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": "a4pdsTLDh3DJfaspM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:04:36"}
{"_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": "LHi85MPsfTrQToyHy", "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": "2020-2-17 13:58:26"}
{"_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": "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": "bSNcqy4Pmwrnwzp4a", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches implies (some g:Group |all p:Person | 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\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "ALczyiQnAidx5bCzB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:33:04"}
{"_id": "3reQnKDPe4Pc5B4mD", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x 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\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x 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": "Z5Wa96iaH44CJov8C", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:43:07"}
{"_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": "YqdzwXxStwzTq2wPi", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  some c : Class | all t : Teacher | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  some 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": "deirjBb3gFhnhaQbK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 18:49:50"}
{"_id": "pyg9L3MkPTaY3Wf5q", "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, 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) -> \n(some t : Teacher | t->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": "vRJvEMnXACPm3crid", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:11:56"}
{"_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": "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": "qk65aJAhNqz6SuknH", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some g:Group |some 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\t\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 p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n\tall s:Student,t:Teacher | some g:Group,c:Class | 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": "R6q5ovEKADrguB3Wo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:32:15"}
{"_id": "gYZrehN4sRmspgWgG", "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": "9jBeMqjnG38Z8igBm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-9-30 10:00:44"}
{"_id": "pbvpQ9u5vTNKszKMJ", "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\t\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: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\tall t1,t2:Teacher | all 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": "9gPdrp3KzupXoR2zC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:13:25"}
{"_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": "XwX8tdS6Dv3i9ypwD", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some g:Group |some 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\t\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 p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n\tall s:Student,t:Teacher | some g:Group,c:Class | 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": "qk65aJAhNqz6SuknH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:32:17"}
{"_id": "eEhv3hxCWsQ2biLXJ", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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 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\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/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WmKcRidJjhvvWMMMG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 23:36:25"}
{"_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": "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": "5KuYb4chYaPERJevh", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher | all c : Class | some d : Class | x->c in Teaches implies x->d 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": "T3NRjYXYopzyqnKXi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:24:16"}
{"_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": "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": "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": "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": "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": "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": "TdNmJSYiMvG7HR2GG", "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 | 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,t2:Teacher | all 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": "aDkY9rzZrbooqjsHi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:16:50"}
{"_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": "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": "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": "2PxTPtJF6Wxjpndq3", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\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\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "C8FbhNEhdGW2stka4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:31:20"}
{"_id": "9gPdrp3KzupXoR2zC", "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\t\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: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\tall t1,t2:Teacher | all 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": "b2zkSFbkz6XHasYvW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:13:22"}
{"_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": "qy4mSTek8wKmbGJw4", "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/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group | some t : Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all c: Class, t : Teacher | some g : Group | c->t->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": "zJPmazkXoL3KZHcvG", "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": "2020-10-29 09:25:32"}
{"_id": "xaMfFNaLMt8mR6np7", "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 = Student\n}\n\n/* 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 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\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x : 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": "Tpv6juX3grMYLzcGG", "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": "2020-10-29 10:07:31"}
{"_id": "ZAH4jtqh49XgKPBLx", "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\t(all c : Class | all s : Student | some g : Group | (s->g)->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\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": "kDxXASmKK4KAMXLbd", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person->this/Group->this/Class}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:04:36"}
{"_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": "v5G78FXBYPuBjimJP", "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\t(all s : Student | some g : Group | all c : Class |  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": "qiE4kbo4azf5H6gG5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 23:01:01"}
{"_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": "4GHpMMqKQoMi9RhTg", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student,t:Teacher | t->c in Teaches implies t->s in Tutors\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": "9W4ZWqP4nwd9EQqDP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:14:46"}
{"_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": "ELWtivLCbrWxedrMi", "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  \n  all s : Person | s 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  all p : Person | no ( (p in Student) & (p 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": "vfo5znAmquDHz3pcq", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 19:36:20"}
{"_id": "23XY3Dpa5L8rhangv", "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  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}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "saBkCB6GXyE3vyfp6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 20:06:37"}
{"_id": "ZAfysMmLzgFaaG9Lm", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall 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\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = 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\tall x, y : Person | x -> y 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": "5vHkesEmM2dBLrqhj", "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": "2020-10-29 09:37:33"}
{"_id": "LTuXJMxtmg9Qfyb2E", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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    all x : Class, s : Student | (some g : Group | x-\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "zjs2sMEfMzTt5aWX4", "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": "2020-10-29 09:45:41"}
{"_id": "zpEgaYPFut2KPMgCK", "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  all p : Person | p in Student\n  \n}\n\n/* There are no teachers. */\npred inv2 {\n  \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  all p : Person | p in Teacher implies p not in Student or 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  all p : Person | p in Student or p in Teacher\n\n  \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  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": "KCwzcuYJkYqdRxjrn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-5 01:13:03"}
{"_id": "AAPJSK5snJJgqYy7N", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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\t\n  \tall t:Teacher | some c:Class | (some g:Group | c->t->g in Groups) implies t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by 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}", "derivationOf": "FTP9btEtJKMK8EET4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:44:53"}
{"_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": "MRSPZ4BJ7XYyih9PT", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 c:Class | some Teaches.c\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pPdWDaKfCCjB7Ax4S", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2021-1-12 00:56:48"}
{"_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": "SaxMsW4j465M586ZA", "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/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher, c : Class | t->c in Class\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jjvctP7a2AmmMrngK", "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": "2020-10-28 18:44:45"}
{"_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": "Bi6CgG3g3Evs4KCzn", "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-10-27 13:14:06"}
{"_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": "3K8Yy4JYRbeazdyba", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 g : Group | c -> s -> g in Groups) and (some t : Teacher | 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": "eBYhdWqpLseLyYNXd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:21:34"}
{"_id": "NHycNPmG9pP7va4rw", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t : Teacher | c->t->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\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* 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\n}", "derivationOf": "ByBGcPnrvGoQczh6F", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:07:14"}
{"_id": "XhL8EfwRRtffEomWT", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | all 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": "Cv5WwzWCKqryhCymN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 13:15:57"}
{"_id": "nfPFZoh7Y77pEeGib", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, g : Group | some c : Class, t : Teacher | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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\tall p : Person | some p1 : Person | p -> p1 in Tutors implies p1 in Teacher\n}", "derivationOf": "M9fDMtdjuScNGWshL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 00:10:29"}
{"_id": "EXTNXKCyxYTMTF7wA", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher | all c : Class | all d : Class | x->c in Teaches and c!=d implies x->d not in Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t : Teacher, y : Teacher | all c : Class | t->c in Teaches and y->c in Teaches t=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": "erNMKGtZngmqpZDsp", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:31:56"}
{"_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": "hYWF5qbWPTp3ieCcE", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}", "derivationOf": "5KsY9E2QSjBFD3ttL", "msg": "The name \"inv2\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 12:46:09"}
{"_id": "5d7sm4aYCARzKyCFH", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p 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": "u8ZX84Za2Mc6sexam", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:28:21"}
{"_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": "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": "tc7CM9SG98fFB92Xp", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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 p1, p2, p3 : Person\n  \t\t| ( p1 != p2 and p2 != p3 and p3 != p1 ) and\n          ( (p2->p1 in Tutors and p2 in Teacher) or\n  \t\t    (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher))\n}", "derivationOf": "TWx8ceGZJpzFMRkxn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:44:48"}
{"_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": "23hRS4QxeZXFFZ2Z9", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | all  c: Class | some 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 p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "v2kSedRcPkL4CvZPR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:26:17"}
{"_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": "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": "6gdAaPsghJPJPeJuy", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not (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 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": "4pb9mtrna4MBBAxwi", "msg": "The name \"_\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 19:46:08"}
{"_id": "L5FcJu2oaphRWjR7e", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 c:Class | (some t:Teacher | t->c in Teaches) implies s->t 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": "NvvEZWhknYmE97GPs", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:08:50"}
{"_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": "NvvEZWhknYmE97GPs", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 c:Class | some t:Teacher | s->t 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": "YzfX3gt4jq5dCk49T", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:07:15"}
{"_id": "4yDB62KuPqgiaXyLL", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall x : Class | some t : Teacher | x -> t in Groups\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall 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": "qdGwcb4aDg83RWX87", "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-10-29 09:31:50"}
{"_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": "gvstTdETREXzmefCn", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group, p : Person | c->p->g in Groups -> some t : Teacher | t->c 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 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/* 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": "2020-10-29 09:14:04"}
{"_id": "EAjAm7YADqMqFRY2H", "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 f : Person | f in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall f : Person | f not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall f : Person | f 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\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8CYYrGSDdMTemReKy", "msg": "& 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": "2020-10-29 10:26:11"}
{"_id": "6wy9ReqWu6uubHczd", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | no (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": "qQqXoEEY5HiecTdR5", "msg": "This expression failed to be typechecked line 62, column 19, filename=/tmp/alloy_heredoc17461231898559052523.als", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 19:43:51"}
{"_id": "QLPB7Ye2kk5wuSM5S", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all 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": "EwdRhJiTfBhWuW3hj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:11:51"}
{"_id": "Dd5sgSHaFYoYHGSYQ", "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\t(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\t(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\t(all t : Teacher | some c : Class | t->c in Class 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\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": "Lr3NaXZsYM6xgmfnX", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:29:55"}
{"_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": "LNFvydzc7Eduy3D48", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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 \tall t:Teacher | some g:Group,c:Class | 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 p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by 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}", "derivationOf": "Yhh8KZPme3WXJ9PPL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:48:15"}
{"_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": "YCFxWdW598SnFizeA", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | some g: Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QRfrzocFPfRmmgx5Q", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:21:40"}
{"_id": "mdjaMW5feszXD7qa5", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | some t, p : Person | c->p->g in Groups implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "k7yYZpNrDdpjQaTrC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:12:33"}
{"_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": "TGgmQ8WtasrpKKeX2", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher,c:Class | some s:Student,g:Group | t->c in Teaches and s->g in c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rqP7dX7z6qLX6JwEH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:10:53"}
{"_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": "YP3NT2ygv8LmNTNtC", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tall x : Student | x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \tall x : Person | x not in Student implies x in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | c -> t in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall 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\tall x : Teacher, y, t : Class | x -> y in Teaches and x -> t in Teaches implies y = 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\tall 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": "6th2s9SruA4kbewjd", "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": "2020-10-29 09:47:05"}
{"_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": "WNu35NyYbQCcJWBoy", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | all c: Class | some 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 p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TJ6LPc8K95gMK8i5Y", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:17:48"}
{"_id": "HEx5SLX83apKtQXfr", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "R3A6HoFPa2nngaKnx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:20:42"}
{"_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": "e4SPoseqJpHqpDc47", "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  \n all p : Person | p in Student\n  \n}\n\n/* There are no teachers. */\npred inv2 {\n\n  no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n  no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \n  all p : Person | p 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": "GBmej8fXTMBssk4sb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 17:33:42"}
{"_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": "uHxTTcfdyecYMWp5c", "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 Teacher implies p not in Student) and (p in Student implies p not in 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\tsome 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": "j4v8j2LninvZxDCou", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 13:34:00"}
{"_id": "KhrDxb2v4CwRXT3nk", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t: Teacher | all s: Student | t.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": "npBHAdwQLHkoc5rSx", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 15:12:28"}
{"_id": "W8M6dLjr3xgtTKCJr", "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\t(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\t(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\t(all t : Teacher | some c : Class | t->c in Class 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\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": "Dd5sgSHaFYoYHGSYQ", "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": "2020-10-29 09:30:06"}
{"_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": "qiqJobh5FWki5nXE3", "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/* 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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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  some c : Class | all t : Teacher | some g : Groups | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all s : Student, c : Class, g : Group, t : Teacher | (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": "9TkRhmhtXrRdzzTry", "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-10-29 09:55:41"}
{"_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": "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": "TRs7Bqg6BNtGCKxQg", "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  \n  all s : Person | s 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  no (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": "u7S9ujTPor2E53b3N", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 19:43:40"}
{"_id": "SCAWT2LTuYd4d4JCc", "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 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": "sXex8zjZ4ZT6WtBnn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:44:56"}
{"_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": "gjWYFg2CttwToKTW4", "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\t(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\t(all t : Teacher , 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "NBYXMimgWSSnYSkKS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:24: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": "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": "qs5jL854BD42XM68g", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \t\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  all 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  some c:Class ,g:Group ,t:Teacher| all s:Student | 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": "z58cCTJkqvcmSBJbk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 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": "dko29vX3AeiPBJR5B", "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\t(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\t(all 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\t(all 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\t(all s:Student, g:Group, c:Class | some t:Teacher | 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": "zydSJSvdPyvNr4NeX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:59:36"}
{"_id": "8ZB5L9P3Dp4tDDxgq", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\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 \n      p1 not in Student and p2 in Student and p2 not 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": "u73QSAfmuZDsurpMJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 22:50:40"}
{"_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": "bZF5FnmaHrk6mH7yh", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | all t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\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": "8XWzQrhkXKsL5NG6K", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-12 01:04:08"}
{"_id": "wAHEsQhb5fXHQ45qZ", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t:Teacher| some x:Class| t->x in Teaches  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n  all x: Class | some t :Teacher | 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\tall x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x 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": "3reQnKDPe4Pc5B4mD", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:44:10"}
{"_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": "WaAHsP45SXTBzCGcR", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 | (some c : Class, g : Group | \n  \t\tc -> t -> g in Groups and t -> c in Teaches) and 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": "fvNY2YTP6qxpqSkLz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:42:56"}
{"_id": "fq4BWxSkmoLFkwaDG", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, 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\tall t: Teacher | some c: Class, g: Group, p : Person | c->p->g in Groups and t -> c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall a, b : Person | a -> b in Tutors implies a in Teacher and b in 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, t : Teacher | 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": "w44kyx5zAWLJp4tsY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:20:34"}
{"_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": "gSetSkSseThAdt6Xf", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some t:Teacher,g:Group,p:Person | (p->g in c.Groups) implies (c->t 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 p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ph8uKaKdxBvSnd7JN", "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": "2020-10-27 15:15:51"}
{"_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": "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": "dZ4cEjpSNFjRsqHE3", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t(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\t(all t : Teacher | all 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\t(all 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\t(all s:Student, g:Group, c:Class | some t:Teacher | 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": "ib2pAGub9K83ACZ7w", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:50:26"}
{"_id": "zmS3r66ppjLkt26j5", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n    \n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "6Bg9ptyMy7oRQdM7L", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:48:30"}
{"_id": "sbXoYe2A6jATKGrEw", "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-10-29 09:13: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": "yN6DiLNB3bcExgjTc", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student, 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/* 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, g : Group, t : Teacher | 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": "vtMCWSD29qQbqkFmW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:53:27"}
{"_id": "rfDMQ9dqQPxCgeeJk", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 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": "3ReiqcMpQiM4JbxfL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 14:23:11"}
{"_id": "w8B9aGWzTv9gamBP8", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all s : Student, c : Class, g : Group, t : Teacher | (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": "o88Cc9Hxioq9bq9GK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:58:28"}
{"_id": "QqQMud2FgMXHccWQk", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, t : Teacher | t -> c in Teaches implies some g : Group | c -> p -> g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "pWDssjFwW9ooeiF7M", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 02:31:14"}
{"_id": "qWm9PnrjX8tgFEhar", "cmd_i": 13, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches and some g:Group, p:Person | 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\n\npred inv14 {\n \tsome s :Student | some c:class | some g:Group | c->s->g in Groups \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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "qD43WjsT7yazjJevp", "msg": "The name \"class\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:54:48"}
{"_id": "FrgTrZezjuMQwHYcB", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some p:Person, g:Group | c->p->g in Groups implies p->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 p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | 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": "h637csoZ9amHiz3mK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:17:05"}
{"_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": "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": "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": "NvqiEbBjyRs9JHGB6", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yTyfGjDTZBPn8tkpD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:50:53"}
{"_id": "6uTfxDNpZrk67GqYE", "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\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "aWFZYHNcbadCx3jNp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:23:03"}
{"_id": "pkAwdd5njCXG3KJoe", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \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  some 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": "MECSZGLW6QSrpAuLd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:28:57"}
{"_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": "hiAe2cYCfLj9rgnAE", "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\t(all s : Student | some g : Group | all c : Class |  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": "jEMA369qQEwAG4v5M", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 23:00:05"}
{"_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": "KBo9bu4A5AmAHCcDB", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\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/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "N98Qgou6dpybxiRvC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 22:55:27"}
{"_id": "XBEQABE6EYPdWiY4S", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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, p : Person, g : Group\n  \t\t| c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1, p2 : Person\n  \t\t| 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 p1, p2 : Person, c : Class, g : Group\n  \t\t| (c->p1->g in Groups and p2->c in Teaches) implies p2->p1 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 p1, p2, p3 : Person \n  \t\t|\n  \t\t  ( (p2->p1 in Tutors and p2 in Teacher) and\n            (p3->p2 in Tutors and p2->p1 in Tutors and p3 in Teacher))\n \n}", "derivationOf": "k5xDAKk6W2te5GmMG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:59:23"}
{"_id": "dgrj2ZCj2Q3D284FS", "cmd_i": 10, "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class |some g:Group |some p:Person | c->p->g  implies (some t:Teacher| t->c in Teaches )\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  all 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\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 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "RJ7gWxNPDK8oBowKA", "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-10-29 09:16:17"}
{"_id": "4W7iJNHhMCRWQkKhq", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \t\n  \tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n \tall s :Person, c:Class | (some g:Group | c->s->g in Groups) implies  (all t:Person| t->c in Teaches implies t->s in Tutors)\n  \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gjxM36p8GvYfaEnuq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-4 17:35:36"}
{"_id": "nyS5jqFzZ8vkFqCu3", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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\tall t: Teacher | some  c: Class | some g: Group | all p: Person |  t->c in Teaches implies c->p->g in Groups and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Di4GCvPyqr9R29v4q", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:31:25"}
{"_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": "zPHzq7e8SpjPETwSA", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, p:Person, g:Group | some t:Teacher | p->g in c.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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vSNkSm3T6aAiJKF8T", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 15:10:21"}
{"_id": "qWNNFPoWr4R7qaTN7", "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 {\nno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nnot (some p : Person | p in Student and p 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 Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall 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 {\nall 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": "479kFoDmmX9HHPirw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 21:49:29"}
{"_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": "YWXG2tkPamiSEEqFS", "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,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all x : Person | x not in Student implies x in Teacher\n}\n\n/* 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/* Every class has teachers assigned. */\npred inv7 {\n  \n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n  all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n  all ps : Person | some c : Class, some g : Group | some t : Teacher | c->ps->g in Groups and t->c in Teaches implies t->ps 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": "R8jBZwn4JvfsFjwqs", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 11:27:57"}
{"_id": "9swvqetNF6SaD3SvD", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "m7AFmLszqomWMeMbs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 19:02:56"}
{"_id": "GRtw9FdRmBADCQ8bM", "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 { all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 { all t : Person | t nor 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": "AMWFazFtsWSqWJDhi", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:39:50"}
{"_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": "D8z74GBvEFfMrNXgc", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\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 -> p1 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": "jWobYHSk7DpgJEyYp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 22:43:35"}
{"_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": "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": "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": "FQwXvLfsHybyndn3F", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "6i7RNhdPEeNjtarcT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:14:34"}
{"_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": "L2pppav5xj4fCvSpb", "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 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\tall x : Class | (some p : Person, g : Group  x->p->g in Groups) -> \n(some t : Teacher | t->x in Teaches)\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": "ZffYnnuXJRBxBiLvo", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:46:28"}
{"_id": "Z36g4GzjnEp8tMrmE", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | some g : Group | all t, p : Person | c->p->g in Groups implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n    ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dGmE2q3ctAbWTZrGJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:13:31"}
{"_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": "hZkLroivvYdc6Mbv3", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \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": "XkskqNNvn7FRyx8aF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 21:18:39"}
{"_id": "AMaDQkWg7hKQ4yso9", "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  \n  all p : Person | p in Student\n  \n}\n\n/* There are no teachers. */\npred inv2 {\n  \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  all p : Person | p in Teacher implies p not in Student or 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  all p : Person | p in Student or p in Teacher\n\n  \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KHwHxyX6e9hwBmxD7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-5 00:55:13"}
{"_id": "zNavqr9nMo94GoTaJ", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  all 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": "NsWMQxnh48ibGALHm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:16:01"}
{"_id": "CJYfie9zZSCKeHfEx", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all t: Teacher | all s: Student | t.Tutors and no s.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": "aTQRpbZuFftFtx2mT", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:58:48"}
{"_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": "BapBiiy3xRYqmcWRQ", "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\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 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 | all 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 t:Teacher | 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\n}", "derivationOf": "axtPFPbkJPJjvyTce", "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": "2020-10-29 09:30:07"}
{"_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": "nrYsmeRFxNT7ZL3hR", "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 | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | (some g:Group | some 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\tall t:Teacher | some c:Class | t->c in Teaches and (some g:Group | some p:Person | c->(p->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 c:Class | some t:Teacher t->c in Teaches implies s->t 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": "LKSPi3ddADC8ti6mi", "msg": "There are 3 possible tokens that can appear here:\n,  { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:04:38"}
{"_id": "2vLMTEbEhvra9ad9z", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n  some x : Class | (all t : Teacher | t->x in Teaches) implies (all p : Person, g : Group | x -> p -> g in Groups)\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "36Jyf6p7sv7Lb76vy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:10:05"}
{"_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": "9q7Xwg4EH3FFFf9Ku", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "voh7WNiQGCktRWHSa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 12:15:47"}
{"_id": "S43YQguysjNigrw9m", "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\t\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\tsome 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": "ijvcep2tdECw8o9sM", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 13:34:23"}
{"_id": "uCfcasMzgF86uAzMF", "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 | 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 | 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,t2:Teacher | all 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  \t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n  \tall g:Group, s:Student,  t:Teacher | some c:Class | ( t->c in Teaches) implies (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\tall s:Student,c:Class,g:Group | some t:Teacher | (t->s in Tutors) implies ( (t->c in Teaches) 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": "G5kJqCv884jjaQwZW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-11-4 22:25:25"}
{"_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": "Tw2MgjtGQnSHJAaH6", "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\t(some t : Teacher, s : Student | 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": "bSxcyXjrTu6hTXxGu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:32:51"}
{"_id": "Jw5JCGzBcXBTKh9Ft", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall x : Person | some c : Class | x->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": "mDRTPFgM82EfevjCg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:13:48"}
{"_id": "LRky2RmiyZeJ3JEaN", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* 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 w : Person | w in Student implies w not in Teacher\n  all w : Person | w in Teacher implies w not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all w : Person | w in Student or w in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t->c in Teaches\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 , c,u : Class | t->c in Teaches and t->u in Teaches implies c=u\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class , t,u : Teacher | t->c in Teaches and u->c in Teaches implies t=u\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class, s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c:Class, t:Teacher | some g:Group | t->c 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": "ShEaGAbAvt7fwdwyL", "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/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 16:03:12"}
{"_id": "Evkir3Png8ZX6m6H8", "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 Teacher implies p not in Student) and (p in Student implies p not in Teacher)\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 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\t all c : Class, s : Student | some g : Group | s->g in c->Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LETcdFei84usSZWqt", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class->this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 14:02:55"}
{"_id": "ZQF2fvQhqzD64qj6M", "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\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "gjWYFg2CttwToKTW4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:25:05"}
{"_id": "PSikcbGmhxukKG2y3", "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 Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\tall c : Class, p, p1 : Person, g : Group | (p -> c not in Teaches or p not in Teacher) implies c -> p1 -> g not in Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "Thzs2vwNrNPMyG9jt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 02:47:17"}
{"_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": "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": "hdJzzCyjKpDyhrESM", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in 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) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, t:Teacher | some g:Group,p:Person | (p->g in c.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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6Kjr6CCrGcmKSLuwE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 15:17:17"}
{"_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": "dPo7e5LYogFyrZC38", "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\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TpJ2ZSCDmK98S9HC3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:52:22"}
{"_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": "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": "KPzY68mxmY2tkZFsX", "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  some p: Person | p.Teaches\n}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KJxtk5vdxFzc8A559", "msg": "There are 1 possible tokens that can appear here:\n}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 13:59:57"}
{"_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": "PLbt7NXWoQ9tmqYxE", "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\tnot (all p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YMRW7RT9F5ovvGxfk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 20:56:18"}
{"_id": "KMkPGnAPnyTSbzDrF", "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\tnot (some p : Person | p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There 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 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, p : Person, g : Group\n  \t\t| c->p->g in Groups implies\n\t\t  (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\tall p1, p2 : Person\n  \t\t| 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 : Person, g : Group\n  \t\t| (t->c in Teaches and 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": "344Yxkn2seKbb4ND5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 21:20:09"}
{"_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": "iFaKPZM2gipAoN6xK", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 p: Person | some c: Class | some 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\tall p: Person | all s: Person | p->s in Tutors implies p 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 | some g: Group | all c: Class | 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": "HQCrPknreNGSnemcw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:12:45"}
{"_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": "yDCChW6Ek75XzXcFY", "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\t(all c : Class | some g : Groups | 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": "RzJ5j9r3hs247Bwkf", "msg": "The name \"s\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 22:58:37"}
{"_id": "E4RQ4xJWRJ55XGCd8", "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 x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all x : Person | x 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": "MajuW8ePCNYWHdmCP", "msg": "The name \"Teachers\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:24:52"}
{"_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": "88KaNLxXoaa7RTwrQ", "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  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NdHs4hRjbGBoaTD9j", "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": "2020-10-28 18:49:04"}
{"_id": "wNDwjPEQTgYQa4MZw", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, g : Group| some p1, p2 : Person | c->p1->g in Groups implies (p2->c in Teaches and p2 in Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all p : Person | some c : Class, g : Group | c->p->g in Groups and p in Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TcC9TYhvXX7ZSE7fq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:19:46"}
{"_id": "GHc2RWEK44kpp2pwf", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher, some x : Class | t->x 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    all x : Class, s : Student | (some g : Group | x-\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "HzxR2p53TC6Byedu2", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:44:47"}
{"_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": "orWNQGvrsfeYWNPnv", "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 in Student or 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 | 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,t2:Teacher | all 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 | some g:Group | \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BapBiiy3xRYqmcWRQ", "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": "2020-10-29 09:40:51"}
{"_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": "fXD3ydAucxS9hfJ4p", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\nhttp:\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are 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  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */ \npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */   \npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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  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 | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c :Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches  implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c:Class | all s :Student| some g:Group |  c-> (s->g)in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n  \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups)  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 c:Class | t->c in Teaches implies (some g:Group |all p:Person | 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\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/* all p1,p2,p3:Person | (p1 in Teacher implies (p2 in  Student and p3 in  Student) ) or\n\t\n\t\t\n  \n  \n }", "derivationOf": "iozBAyNwXrSDmBNRr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:42:54"}
{"_id": "jCKrFNvSaP3ZrYDwu", "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, 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 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\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 p : Person, c : Class | some g : Group | c->p->g in Groups implies\n  some t : Teacher | t->c in Teaches implies 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": "evDDgHQTMyGAuN9k7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:34:59"}
{"_id": "HyBa7vWaii8HNpucr", "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\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\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": "noTLTp2jhd9y4CBQn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 19:28:44"}
{"_id": "mFzqZc4MgazGp33xG", "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  \n  all p : Person | p in Student\n  \n}\n\n/* There are no teachers. */\npred inv2 {\n  \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  all p : Person | p in Teacher implies p not in Student or 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  all p : Person | p in Student or p in Teacher\n\n  \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  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": "vQQ3smqapTTXCE3Ew", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-5 01:07:14"}
{"_id": "cjxg4kXhKnBBBqJHY", "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 all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p: Person {\n  (p in Teacher implies p not in Student)\n  or\n  (p not in Teacher implies p in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fyfrdbD3YdLKfxknG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 18:35:21"}
{"_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": "WcAXGXGgjH8QgAWRj", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, 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\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/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NNtjFRcZtYFLYKueg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:44:19"}
{"_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": "S8A8ohdBoQg36Ntyx", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 t:Teacher | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vCa8uRg72HdW3ydpz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2021-1-12 00:55:32"}
{"_id": "gjxM36p8GvYfaEnuq", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some 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  \tall t:Teacher | some p:Person,c:Class,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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n \tall s :Person, c:Class | (some g:Group | c->s->g in Groups) implies  (all t:Person| t->c in Teaches implies t->s in Tutors)\n  \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xYoqCtSsRysTrZGpR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-4 17:24:41"}
{"_id": "NJPYPraBiovZn4cM6", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\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\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xvAWLGxRq4abiy7Ai", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:30:19"}
{"_id": "KJb6Tv3NQWjRpS5wj", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student, g : Group, t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 { \n  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": "7sGbA2c2ZzQecwRhM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:45:15"}
{"_id": "6zSwXZEJHWPEgx5x3", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 (Person-Student-Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t:Teacher | some t.Teaches\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": "9ur42LFqqRXRi2a8S", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:42:54"}
{"_id": "hT76Pcqs68PSakbZX", "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  all c : Class | (some p : Person, g : Group | x -> p -> g in Groups) implies \n\t(some t : Teacher | t -> x 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": "YH3ANm7Y5Qe5dSYem", "msg": "The name \"x\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:16:57"}
{"_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": "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": "LtR7BKwvEcKmwpc6C", "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  \n  all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n  \n  no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n  \tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  \n  all p : Person | p 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": "PcNGRARKLpLZ76TWS", "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-10-29 09:35:42"}
{"_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": "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": "yLfvMJWB52dj4jgTP", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "sWaDNAbz8QWFh52bC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:15:12"}
{"_id": "kLhB5aoZjkRKfotHc", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno 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 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": "Sx6RekmJK45YBacrk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-12 00:58:19"}
{"_id": "ZEn5bb4nXCum9EK9J", "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\t(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\t(all 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\t(all 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  (all s:Student, g:Group | some c:Class, t:Teacher | 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": "KPTwoFqQDz4jeKvY8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:39:42"}
{"_id": "g7dyxoASeFACeg4ys", "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 Teacher implies p not in Student) and (p in Student implies 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, 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 | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, g:Groups | some t:Teacher | g in c.Groups.Person 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\tall p,p1:Person | p->p1 in Tutors implies p in Teacher and p1 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Km8EQ4g7rjx635dW9", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {none}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 15:07:06"}
{"_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": "nd5XxgPZw4BdHPXSY", "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\tno Teacher\n    \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tno (Student & Teacher)\n\t\n  \t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t all p : Person | p not in Student and p not in Teacer \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dbujb9Qkyhm74JGtT", "msg": "The name \"Teacer\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 19:47:31"}
{"_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": "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": "T3NRjYXYopzyqnKXi", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher | some c : Class | some d : Class | x->c in Teaches implies x->d 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": "6agLZvTb43btaJLt9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:24:08"}
{"_id": "FBxtDGTP9kgAyfJ2M", "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 f : Person | f in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall f : Person | f not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall f : Person | f 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": "8gRzMiQQxdjX3Co6W", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:46:36"}
{"_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": "4aMhL2qX5LwCEusXY", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> 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/* 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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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  \n  \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall x : Class | some p: Person, g : Group | x->p->g in Groups implies all t : Teacher | t->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": "TBvP3tNH2PBGEkJGN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:27:41"}
{"_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": "2m7os9D85YeHhiRwa", "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 x: Person | x in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tall x: Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall 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\tall x: Person | x not in Student implies x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x: Teacher | some c: Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall 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\tall x,y: Teacher, z: Class | x->z in Teaches and y->z in Teaches implies x=y\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, g: Group, p: Person, 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\tall t: Teacher | some c: Class, g: Group, 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\tall p,pp: Person | p->pp 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": "cifD3vkxm948pTxHL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:11:34"}
{"_id": "XHuX9ZvQn6LbA8sNo", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, 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}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all s : Student, c : Class, g : Group | all t : Teacher | (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": "7WbKHvyXxxXsBiiza", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:50:24"}
{"_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": "EwtErnyXXskQNzHCw", "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\tno (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 (Person-Student-Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t:Teacher | some t.Teaches\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some( c.~Teaches & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t:Teacher | lone t.Teacher\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AKkCKeZ6a2fYJ5786", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is this/Teacher (type = {this/Person})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2021-1-13 18:21:39"}
{"_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": "vup8o8sEAhf4KvDEP", "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\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\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p,q:Person | p in Teacher and q in Student implies p != q\n\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 x: Class, t:Teacher| t->x in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  \n  all t : Teacher | some x : Class | t->x 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  all t : Teacher | lone c : Class | t -> c in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n  all c : Class | lone t : Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n   all x : Class, s : Student | some g : Group | x->s->g in Groups\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n  all x : Class | (some p: Person, g : Group | x->p->g in Groups) implies (some t : Teacher | t->x in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n  all t : Teacher  | (all c : Class, g : Groups, p : Person | t -> c in Teaches) implies c -> p -> g in Groups\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall 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\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": "NEGDP5PAXfsqyFuuk", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 10:14:54"}
{"_id": "Frqsi5ZsStamxu5iw", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 | some 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 p: Person | all s: Person | p->s in Tutors implies p 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 | some g: Group | all c: Class | 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": "FbNvx6N6cXuaExBHo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:15:45"}
{"_id": "G4TbDqXuAML6Y59DW", "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\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tno (Student & Teacher)\n\t\n  \t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t no Student and no 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": "BZo5PBawj5ihNtWMg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 19:43:24"}
{"_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": "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": "h9xibP2Gr4hufwkkr", "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\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: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\tall t1,t2:Teacher | all 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": "KvLKomMqbLwjPA33X", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:16:31"}
{"_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": "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": "7EavgKdPX4HtZt8sP", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Person, g : Group | some t : Person | c->s->g in Groups implies t->c in Teaches and t in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t,s : Person | some c : Class, g : Group | c->s->g in Groups and t->c in Teaches and t in Teacher and s in Student\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": "natGJj2MgJurmgrt4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:07:25"}
{"_id": "W9dt9jH7qra5WbqTW", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There 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, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n/* 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 t, t1 : Teacher | t in t1.Tutors || t in t1.Tutors.Tutors \n}", "derivationOf": "BTGgJzDYygPBNBCEh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-30 22:39:40"}
{"_id": "cBwwHan7KXJsf9s4Z", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n\t\n  \t(all c : Class | some p : Teacher | p -> c in Teaches) implies \n\t\t(all g : Group, c : Class, p : Person | c -> p -> g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  \tall p : Person | all c : Class, g : Group | c -> p -> g in Groups and p in Teacher\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  \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": "2C2m8AtvMH8brGMdj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-28 03:14:56"}
{"_id": "FW7RqgcDzwgiZ8QAk", "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  { all x: Class | some p.Person, g.Group: x -> p -> g in Groups implies some t.Teacher: t->x in Teaches}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\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": "2020-10-29 09:17:42"}
{"_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": "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": "WwT9Q9wzmn4xCGZwi", "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 p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n  (p in Student implies p not in Teacher)\n  or\n  (p in Teacher implies p not in Student)\n  }\n}\n  \n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class |\n    t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class | all s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \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  all 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 c : Class , s : Student , t : Teacher | \n    ((c->s in Class )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": "4gPPS4GrotKLGphtw", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-29 09:49:24"}
{"_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": "b3B6khMQ7utAPBRML", "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, 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 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\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": "yv5dYFk68aW9yfSNZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:20:56"}
{"_id": "cAFXrZpknguEL5f2M", "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\npred inv4 {\n\tall p : Person | not p in Student and not 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": "9SJtjX2sFRG4KppNQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 20:54:53"}
{"_id": "sMykGM7Tk8bStBh56", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall 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 Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There 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 | 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 c:Class | all t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall c:Class | some t:Teacher | some 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": "N9DAA7CekzfZgd8Px", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:53:37"}
{"_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": "ojZHkML9A5fbB3XTw", "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  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/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student, 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/* 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, g : Group | some t : Teacher | 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": "yN6DiLNB3bcExgjTc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:55:05"}
{"_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": "YNmXtKDr5Qnhd5ydk", "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 p : Person, c : Class, all g : Group | p in Teacher implies c -> p -> g in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TPPRt3XJCdemiKi8s", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-28 14:06:57"}
{"_id": "2uLujp6o2smsjktKg", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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 |\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher, c : Class | some g : Group | 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": "Pirjqb34sajneLxyx", "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": "2020-10-27 22:32:10"}
{"_id": "2jPq4PKYKApqhjH6n", "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\t(all 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": "FrWZZNSdLtSEQ86f2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-28 22:50:12"}
{"_id": "YTdYZfESZ7Kh35Zst", "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 = Student\n}\n\n/* 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 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\tall x : Person | x in Person implies x not in Student and x 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": "trzsKsCHgJnP9Hbdk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:02:10"}
{"_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": "sg8KQRoXzYYCwxYeD", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class | (some c.Groups) implies (some (Teacher & c.~Teaches))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n  all t : Teacher | some (t.Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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  all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n  all p : Person {\n  \t(some (p.(~Tutors) & Teacher)) or\n  \t(some (p.(~Tutors).(~Tutors) & Teacher)) or\n\t(some (p.(~Tutors).(~Tutors).(~Tutors) & Teacher))\n  }\n}", "derivationOf": "qMtpk3wmGxmhyLyGR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2021-1-13 17:11:50"}
{"_id": "pdeFzuP3mcoizneCW", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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  \n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->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 p: Teacher | some c: Class | some g: Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p: Person | all s: Person | p->s in Tutors implies p 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 | some g: Group | all c: Class | 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": "ynZ5S8YzFdsaNg4cS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 10:14:30"}
{"_id": "4fAWYf25RLbgCKzdW", "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  \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies \n\t(some t : Teacher | t -> c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\n\npred inv12 {\n \tall t : Teacher | some c : Class, g : Group, p : Person | (c -> p -> g in Groups and t -> c in Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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, t : Teacher | some g : Group, c : Class | \n  \t\t(c -> s -> g in Groups and t -> c in Teaches) and (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": "mX2RQAMAm2BdQmReF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:49:08"}
{"_id": "e7JrNuKaCf8Jc5FQy", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ymbtkdhKyeZv29GsE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 11:28: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": "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": "Xi3q6EMfRmFA4jYxQ", "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\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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, p : Person, g : Group | p -> c in Teaches and p in Teacher and c -> p -> 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\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, g : Group | some c : Class, t : Teacher | c -> s -> g in Groups and t -> c in Teaches \n  \t\timplies 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\tall p1, p2, p2 : Person | (p1 -> p2 in Tutors implies p2 in Teacher) or (p1 -> p2 in Tutors and p2 -> p3 in Tutors implies p3 in Teacher)\n}", "derivationOf": "Wj4CgkfaSv8poLGTr", "msg": "The name \"p3\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 23:55:13"}
{"_id": "6JveuYuzsAHaPAQnq", "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\npred inv4 {\n\tall p : Person | not(not p in Student and not p in Teacher)\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t -> c in Teaches \n}\n\npred duvida {\n\tsome c : Class, p : Person | p -> c in Teaches implies p in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */ \npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n  \n}\n\npred duvida2 {\n\tsome t : Teacher | all c : Class | t -> c in Teaches\n}\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\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher, c : Class | all 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/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "L9iKe7zvEfRhuPbdH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-27 23:28:11"}
{"_id": "KexfChHR6vZKwFFB8", "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 = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent in Person - Teacher  \n  \tTeacher in Person - Student\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 \tPerson = Student + Teacher\n\tall x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  \tsome c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | some c : Class | x->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher | all c : Class | all d : Class | x->c in Teaches and c!=d implies x->d not in Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t : Teacher, y : Teacher | all c : Class | t->c in Teaches and y->c in Teaches implies t=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": "EXTNXKCyxYTMTF7wA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 10:32: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": "oFdqwjEbA6Sib7PQq", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person  {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class  {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person  {}\n\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n  all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n  all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  all p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher | 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  all c : Class, t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  all c : Class, s : Student, 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/* 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": "shJHbEQJWCEF5aW8y", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-29 09:47:10"}
{"_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": "fEvxH9YSh8fTeKmRY", "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\t(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\t(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\t(all c : Class, t : Teacher | t->c in Class implies some g : Group, s : Student | 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\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": "wvBLwFwSMnEbvuRMf", "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": "2020-10-29 09:22:06"}
{"_id": "FB3ey4swMBhzx6ifR", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\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 | all t: Teacher | s not in Teacher and t 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 | all t: Teacher | c->t->Group\n}\n\n/* Every 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/* Teachers are assigned at most one class. */\npred inv8 {\n  all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YWTMaMSF8kQz6yMiJ", "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-10-29 09:36:46"}
{"_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": "Tr4w8nevfp9q8o8C5", "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  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 { \n    (p in Student implies p not in Teacher)\n    or\n    (p in Teacher implies p not in Student)\n  }\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n  all p : Person | p in Teacher or p in Student \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n  some t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n  all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n  all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n  all t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n  all t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n  all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n  \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n  all p1, p2 : Person{\n    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": "o985wBzWR7Fhx6y6A", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-29 09:14:48"}
{"_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": "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": "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": "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": "qSeSD628rdtNAYrPL", "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\n/* Some persons are students. */\nsig Student in Person  {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred 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": "CDidD6mhrTvFPJzNJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-10-27 14:03:36"}
{"_id": "RNwtaZS8kjgDxoGTb", "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 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": "wqADQ7DhQH9QfWM6v", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-10-22 10:25:56"}
{"_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": "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": "jYv52ndMdsJm7LiDs", "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  \n  all p : Person | p in Student\n  \n}\n\n/* There are no teachers. */\npred inv2 {\n  \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  all p : Person | p in Teacher implies p not in Student or 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  all p : Person | p in Student or p in Teacher\n\n  \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AMaDQkWg7hKQ4yso9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-11-5 00:55:16"}
{"_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": "2R2NrFk8cwda97mKH", "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 {\n  all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | (p in Student implies p not in Teacher) or (p in Teacher implies p not in Student)\n  \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall t:Teacher |some c:Class | t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\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": "zRDGkvFpBvqe6HbKA", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 11:52:27"}
{"_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": "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": "u6ZMMryRRJK38zjZv", "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\tno Teacher\n    \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n  \tno (Student & Teacher)\n\t\n  \t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student and no Teacher and Group.Person not in Student and Group.Person 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": "QGoQ8NKKwzPtDFYSG", "msg": "This cannot be a legal relational join where\nleft hand side is this/Group (type = {this/Group})\nright hand side is this/Person (type = {this/Person})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-10-27 20:06:41"}
{"_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"}