{"_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->