sS ai_weightChangeBot_theory() { ret [[ import math theory validity { // a human weighs between 80 and 400 pounds $x is a human & $x weighs ($y pounds) => $y >= 80 & $y <= 400 contradiction => say (That can't be right) } theory (weight change) { $x weighs ($y pounds) & last time $x weighed ($z pounds) => proc { if ($y < $z): say (That is great!) else if ($y > $z): say (Aw, too bad, tomorrow is another day.) else: say (Tomorrow will be better) } } theory (remember last weight) { $x weighs ($y pounds) => proc { unless contradiction: delete all (last time $x weighed ($z pounds)) store (last time $x weighed ($y pounds)) } } theory (interpret input) { $x says (i weigh $y pounds) => $x weighs ($y pounds) $x says (my weight is $y pounds) => $x weighs ($y pounds) } ]]; }