expressions.taq
$ java -jar taq.jar expressions
Running query expressions in global scope
expressions(
can_add=true,
can_subtract=true,
can_multiply=true,
can_divide=true,
can_override_precedence=true,
can_assign=true,
can_evaluate=true
)
Description
expressions.taq performs a sequence of arithmetic operations to
demonstrate that TAQ follows Java notation and precedence in regard to
those operations.
axiom x_y (x,y) { 1, 2 }
template evaluate(
boolean can_add = x + y == 3,
boolean can_subtract = y - x == 1,
boolean can_multiply = x * y == 2,
boolean can_divide = 6 / y == 3,
boolean can_override_precedence = (y + 1) * 2 > x * 5,
boolean can_assign = (y *= 3) == 6 && y == 6,
boolean can_evaluate = can_add && can_subtract && can_multiply && can_divide && can_override_precedence && can_assign
)
query<term> expressions (x_y:evaluate)