This document contains acceptance tests gained in the form of bug reports.

Number unification

The following test exercises the unification between numbers, in particular between real and interger numbers.

Goal Theory success(String goal,String theory)
0.0 = 0. null false
0.9 = 0. null false
0 = 0.9. null false

Number comparison

The following test exercises the comparison between numbers, in particular between real and interger numbers.

Goal Theory success(String goal,String theory)
1 == 1.0. null false
1.0 == 1. null false

Managing operators

The following test exercises predicates for operator management.

Goal Theory success(String goal,String theory)
current_op(_, _, '+'). null true
Goal Theory Variable Solution success(String goal,String theory,String variable,Strng solution)
op(10, yfx, ['@', ':']), current_op(10, yfx, Op). null Op ':' true
op(10, yfx, ['@', ':']), current_op(10, yfx, Op). null Op '@' true

Expanding subgoals

The following test exercises the expansion of subgoals in flat lists.

First of all, let's start an appropriate fixture containing an engine.

Goal Theory Variable Solution success(String goal,String theory,String variable,Strng solution)
p(X), X. a. p((a,fail)). p((a)). X a true

Functor identification

The following test exercises the identification of functors (and their subsequent evaluation) in subgoals.

First of all, let's start an appropriate fixture containing an engine.

Goal Theory Variable Solution success(String goal,String theory,String variable,Strng solution)
X is 5, Y =.. ['+', X, 2], K is Y. null X 5 true
X is 5, Y =.. ['+', X, 2], K is Y. null Y '+'(5,2) true
X is 5, Y =.. ['+', X, 2], K is Y. null K 7 true
X is 5, Y =.. ['+', X, 2], 10 > Y. null X 5 true
X is 5, Y =.. ['+', X, 2], 10 > Y. null Y '+'(5,2) true

Asserting/retracting clauses

The following test exercises the assertion/retraction of clauses in the knowledge base.

You cannot retract clauses belonging to a library's theory.

Goal Theory success(String goal,String theory)
retract(call(X)). null false

Arithmetic Operations

The following test exercises arithmetic operations on long numbers and on boundaries between int and long.

First of all, let's start an appropriate fixture containing an engine.

Goal Theory success(String goal,String theory)
ops(A), assert(ops_result(A)). ops(s). ops(y). ops(z). true
retractall(p(X)). p(0) :- !. p(1). true
Goal Theory success(String goal,String theory)
p(X). p(0) :- !. p(1). true
Goal Theory Variable Solution success(String goal,String theory,String variable,Strng solution)
ops(X). ops(s). ops(y). ops(z). X s true
ops(X). ops(s). ops(y). ops(z). X y true
ops(X). ops(s). ops(y). ops(z). X z true