--- The "agenda design pattern" --- --- (c) EM/1415 open RelCalc sig A { -- the agenda owner R : set B -- her/his tasks of type B , S : set C -- her/his tasks of type C } sig B { f : one D } -- slot of tasks of type B sig C { g : one D } -- slot of tasks of type C sig D {} -- where theoverlapping is checked pred inv{ -- no tasks of whatever type overlap img[R] & ker[f] in iden -- tasks in R don't overlap img[S] & ker[g] in iden -- tasks in R don't overlap ~S . R & g . ~f in iden -- mutual overlapping forbidden } run { inv } -- special case: R = S and f = g, then img[R] & ker[f] in iden is enough