Warning: session_start(): open(/var/lib/php/sessions/sess_c69i150dp0ntaspnfnvvir9ttf, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
abstract sclass Prop implements IStatement, IFieldsToList {}
static withToList record $HappensBefore$(A event1, B event2) extends Prop {}
static withToList record $HappensAtDay$(A event, B y) extends Prop {}
static withToList record $LessThan$(A x, A y) extends Prop {}
// we can fully define a statement on primitive values
// full define $LessThan(int x, int y) = x < y;
// we can output a variable
// full define $LessThan(int x, var y) = y := any int bigger than x;
/*
Event 1 happens before event 2 :=
vars {event 1, event 2, X, Y}
Event 1 happens at day X.
Event 2 happens at day Y.
X < Y.
*/
static Bool checkProposition(Prop p) {
/*if (p cast $LessThan$)
if (matchRecordWithTypes(p, int.class, int.class))
ret (int) p.x < (int) p.y;*/
if p is $LessThan$(int x, int y) {
ret x < y;
}
null;
}
p-exp {
assertEqualsVerbose(true, checkProposition($LessThan$(1, 5)));
assertEqualsVerbose(false, checkProposition($LessThan$(5, 1)));
assertEqualsVerbose(null, checkProposition($LessThan$("what", "ever")));
}