Arithmetic evaluation

This predicate causes an expression to be evaluated and a value to be unified with a term.

1. is/2

'is'(Result, Expression) is true iff the value of evaluating Expression as an expression is Result .

Templates and modes for the predicate are as follows:

is(?term, @evaluable)

Note that is is a predefined operator.

1.1 Example tests

Let's start with some simple tests verifying success or failure of single goals.

Goal Theory success(String goal,String theory)
'is'(3, 3). null true
'is'(Result, 3 + 11.0). null true
X = 1 + 2, Y is X * 3. null true

Goal Theory success(String goal,String theory)
'is'(3, 3.0). null false
'is'(foo, 77). null false

Let's start with some simple tests verifying exception of single goals.

Goal Theory success(String goal,String theory)[With Execption] Type Of Error
is(_, foo). null true
'is'(77, N). null true