Warning: session_start(): open(/var/lib/php/sessions/sess_fd0st0j3tfkcfvhb58t1nvvp46, 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
set flag AllowMetaCode. meta-transformNow { tok_once }
replace Var with ValuelessVar.
replace VarMap with Map.
replace SimpleStatements with MatchableRecords.
replace Env with SimpleStatements.
abstract sclass Prop implements IStatement, IFieldsToList {}
static withToList record Did$HappenBefore$(A event1, B event2) {}
static withToList record WhenDid$Happen(O event) extends Prop {}
static withToList record $HappensAtSecond$(A event, B y) extends Prop {}
static withToList record $LessThan$(A x, B y) extends Prop {}
static withToList record $BiggerThanOrEqualTo$(A x, B y) extends Prop {}
static withToList record $AnyIntBiggerThan(O x) {}
static withToList record $is$(O a, O b) {}
static O answer(Env env, O p) {
if p is WhenDid$Happen(O event) {
ret statements.fulfillVariable(var -> $HappensAtSecond$(event, var));
}
if p is Did$HappenBefore$(O event1, O event2) once {
Int time1 = optCast answer(env, WhenDid$Happen(event1));
if (time1 == null) break;
Int time2 = optCast answer(env, WhenDid$Happen(event2));
if (time2 == null) break;
ret time1 < time2;
}
null;
}
p-exp {
SimpleStatements env = new(
$HappensAtSecond$("stuff", 10),
$HappensAtSecond$("more stuff", 20)
);
assertEqualsVerbose(true, answer(env, print(Did$HappenBefore$("stuff", "more stuff"))));
assertEqualsVerbose(false, answer(env, print(Did$HappenBefore$("more stuff", "stuff"))));
assertEqualsVerbose(null, answer(env, print(Did$HappenBefore$("stuff", "any other stuff"))));
}