Skip to content

Commit

Permalink
upgrade to latest projog-test - resolves #205
Browse files Browse the repository at this point in the history
  • Loading branch information
s-webber committed Dec 29, 2021
1 parent 70fea56 commit dc6aac7
Show file tree
Hide file tree
Showing 237 changed files with 7,489 additions and 9,908 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
<dependency>
<groupId>org.projog</groupId>
<artifactId>projog-test</artifactId>
<version>0.4.0</version>
<version>0.5.0-SNAPSHOT</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand Down
48 changes: 24 additions & 24 deletions src/main/java/org/projog/core/math/builtin/Abs.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,32 @@
import org.projog.core.math.AbstractUnaryArithmeticOperator;

/* TEST
%QUERY X is abs(-1)
%ANSWER X=1
%QUERY X is abs(1)
%ANSWER X=1
%QUERY X is abs(0)
%ANSWER X=0
%?- X is abs(-1)
% X=1
%QUERY X is abs(43.138)
%ANSWER X=43.138
%QUERY X is abs(-832.24)
%ANSWER X=832.24
%QUERY X is abs(9223372036854775807)
%ANSWER X=9223372036854775807
%QUERY X is abs(-9223372036854775807)
%ANSWER X=9223372036854775807
%?- X is abs(1)
% X=1
%?- X is abs(0)
% X=0
%?- X is abs(43.138)
% X=43.138
%?- X is abs(-832.24)
% X=832.24
% Note: As this functionality is implemented using java.lang.Math.abs(), when called with an integer argument that is equal to the value of java.lang.Long.MIN_VALUE
% (i.e. the most negative representable long value) the result is that same value, which is negative.
%QUERY X is abs(-9223372036854775808)
%ANSWER X=-9223372036854775808
*/
%?- X is abs(9223372036854775807)
% X=9223372036854775807
%?- X is abs(-9223372036854775807)
% X=9223372036854775807
% Note: As this functionality is implemented using java.lang.Math.abs(), when called with an integer argument that is equal to the value of java.lang.Long.MIN_VALUE
% (i.e. the most negative representable long value) the result is that same value, which is negative.
%?- X is abs(-9223372036854775808)
% X=-9223372036854775808
*/
/**
* <code>abs</code> - returns the absolute value of a numeric argument.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/projog/core/math/builtin/Add.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import org.projog.core.math.AbstractBinaryArithmeticOperator;

/* TEST
%LINK prolog-arithmetic
*/
%LINK prolog-arithmetic
*/
/**
* <code>+</code> - performs addition.
*/
Expand Down
38 changes: 19 additions & 19 deletions src/main/java/org/projog/core/math/builtin/BitwiseAnd.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,30 @@
import org.projog.core.math.AbstractBinaryIntegerArithmeticOperator;

/* TEST
%QUERY X is 3 /\ 3
%ANSWER X=3
%QUERY X is 3 /\ 7
%ANSWER X=3
%QUERY X is 3 /\ 6
%ANSWER X=2
%?- X is 3 /\ 3
% X=3
%QUERY X is 3 /\ 8
%ANSWER X=0
%?- X is 3 /\ 7
% X=3
%QUERY X is 43 /\ 27
%ANSWER X=11
%?- X is 3 /\ 6
% X=2
%QUERY X is 27 /\ 43
%ANSWER X=11
%?- X is 3 /\ 8
% X=0
%QUERY X is 43 /\ 0
%ANSWER X=0
%?- X is 43 /\ 27
% X=11
%QUERY X is 0 /\ 0
%ANSWER X=0
*/
%?- X is 27 /\ 43
% X=11
%?- X is 43 /\ 0
% X=0
%?- X is 0 /\ 0
% X=0
*/
/**
* <code>/\</code> - performs bitwise addition.
*/
Expand Down
34 changes: 17 additions & 17 deletions src/main/java/org/projog/core/math/builtin/BitwiseOr.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,30 @@
import org.projog.core.math.AbstractBinaryIntegerArithmeticOperator;

/* TEST
%QUERY X is 3 \/ 3
%ANSWER X=3
%?- X is 3 \/ 3
% X=3
%QUERY X is 3 \/ 7
%ANSWER X=7
%?- X is 3 \/ 7
% X=7
%QUERY X is 3 \/ 6
%ANSWER X=7
%?- X is 3 \/ 6
% X=7
%QUERY X is 3 \/ 8
%ANSWER X=11
%?- X is 3 \/ 8
% X=11
%QUERY X is 43 \/ 27
%ANSWER X=59
%?- X is 43 \/ 27
% X=59
%QUERY X is 27 \/ 43
%ANSWER X=59
%?- X is 27 \/ 43
% X=59
%QUERY X is 43 \/ 0
%ANSWER X=43
%?- X is 43 \/ 0
% X=43
%QUERY X is 0 \/ 0
%ANSWER X=0
*/
%?- X is 0 \/ 0
% X=0
*/
/**
* <code>\/</code> - bitwise 'or'.
*/
Expand Down
34 changes: 17 additions & 17 deletions src/main/java/org/projog/core/math/builtin/BitwiseXor.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,30 @@
import org.projog.core.math.AbstractBinaryIntegerArithmeticOperator;

/* TEST
%QUERY X is 3 xor 3
%ANSWER X=0
%?- X is 3 xor 3
% X=0
%QUERY X is 3 xor 7
%ANSWER X=4
%?- X is 3 xor 7
% X=4
%QUERY X is 3 xor 6
%ANSWER X=5
%?- X is 3 xor 6
% X=5
%QUERY X is 3 xor 8
%ANSWER X=11
%?- X is 3 xor 8
% X=11
%QUERY X is 43 xor 27
%ANSWER X=48
%?- X is 43 xor 27
% X=48
%QUERY X is 27 xor 43
%ANSWER X=48
%?- X is 27 xor 43
% X=48
%QUERY X is 43 xor 0
%ANSWER X=43
%?- X is 43 xor 0
% X=43
%QUERY X is 0 xor 0
%ANSWER X=0
*/
%?- X is 0 xor 0
% X=0
*/
/**
* <code>xor</code> - bitwise 'exclusive or'.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/projog/core/math/builtin/Divide.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import org.projog.core.term.TermType;

/* TEST
%LINK prolog-arithmetic
*/
%LINK prolog-arithmetic
*/
/**
* <code>/</code> - performs division.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/projog/core/math/builtin/IntegerDivide.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import org.projog.core.math.AbstractBinaryIntegerArithmeticOperator;

/* TEST
%LINK prolog-arithmetic
*/
%LINK prolog-arithmetic
*/
/**
* <code>//</code> - performs integer division.
* <p>
Expand Down
58 changes: 29 additions & 29 deletions src/main/java/org/projog/core/math/builtin/Max.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,35 @@
import org.projog.core.math.Numeric;

/* TEST
%QUERY X is max(5,5)
%ANSWER X=5
%QUERY X is max(7,8)
%ANSWER X=8
%QUERY X is max(3,2)
%ANSWER X=3
%QUERY X is max(2.5,2.5)
%ANSWER X=2.5
%QUERY X is max(2.75,2.5)
%ANSWER X=2.75
%QUERY X is max(1,1.5)
%ANSWER X=1.5
%QUERY X is max(2,1.5)
%ANSWER X=2
%QUERY X is max(-3,2)
%ANSWER X=2
%QUERY X is max(-3,-2)
%ANSWER X=-2
%QUERY X is max(-2.5,-2.25)
%ANSWER X=-2.25
%QUERY X is max(0,0)
%ANSWER X=0
%QUERY X is max(0.0,0.0)
%ANSWER X=0.0
%QUERY X is max(0,0.0)
%ANSWER X=0.0
%QUERY X is max(0.0,0)
%ANSWER X=0
*/
%?- X is max(5,5)
% X=5
%?- X is max(7,8)
% X=8
%?- X is max(3,2)
% X=3
%?- X is max(2.5,2.5)
% X=2.5
%?- X is max(2.75,2.5)
% X=2.75
%?- X is max(1,1.5)
% X=1.5
%?- X is max(2,1.5)
% X=2
%?- X is max(-3,2)
% X=2
%?- X is max(-3,-2)
% X=-2
%?- X is max(-2.5,-2.25)
% X=-2.25
%?- X is max(0,0)
% X=0
%?- X is max(0.0,0.0)
% X=0.0
%?- X is max(0,0.0)
% X=0.0
%?- X is max(0.0,0)
% X=0
*/
/**
* <code>max</code> - finds the maximum of two numbers.
*/
Expand Down
58 changes: 29 additions & 29 deletions src/main/java/org/projog/core/math/builtin/Min.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,35 @@
import org.projog.core.math.Numeric;

/* TEST
%QUERY X is min(5,5)
%ANSWER X=5
%QUERY X is min(7,8)
%ANSWER X=7
%QUERY X is min(3,2)
%ANSWER X=2
%QUERY X is min(2.5,2.5)
%ANSWER X=2.5
%QUERY X is min(2.75,2.5)
%ANSWER X=2.5
%QUERY X is min(1,1.5)
%ANSWER X=1
%QUERY X is min(2,1.5)
%ANSWER X=1.5
%QUERY X is min(-3,2)
%ANSWER X=-3
%QUERY X is min(-3,-2)
%ANSWER X=-3
%QUERY X is min(-2.5,-2.25)
%ANSWER X=-2.5
%QUERY X is min(0,0)
%ANSWER X=0
%QUERY X is min(0.0,0.0)
%ANSWER X=0.0
%QUERY X is min(0,0.0)
%ANSWER X=0.0
%QUERY X is min(0.0,0)
%ANSWER X=0
*/
%?- X is min(5,5)
% X=5
%?- X is min(7,8)
% X=7
%?- X is min(3,2)
% X=2
%?- X is min(2.5,2.5)
% X=2.5
%?- X is min(2.75,2.5)
% X=2.5
%?- X is min(1,1.5)
% X=1
%?- X is min(2,1.5)
% X=1.5
%?- X is min(-3,2)
% X=-3
%?- X is min(-3,-2)
% X=-3
%?- X is min(-2.5,-2.25)
% X=-2.5
%?- X is min(0,0)
% X=0
%?- X is min(0.0,0.0)
% X=0.0
%?- X is min(0,0.0)
% X=0.0
%?- X is min(0.0,0)
% X=0
*/
/**
* <code>min</code> - finds the minimum of two numbers.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/projog/core/math/builtin/Minus.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import org.projog.core.math.AbstractUnaryArithmeticOperator;

/* TEST
%LINK prolog-arithmetic
*/
%LINK prolog-arithmetic
*/
/**
* <code>-</code> - minus operator.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/projog/core/math/builtin/Modulo.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import org.projog.core.math.AbstractBinaryIntegerArithmeticOperator;

/* TEST
%LINK prolog-arithmetic
*/
%LINK prolog-arithmetic
*/
/**
* <code>mod</code> - finds the remainder of division of one number by another.
* <p>
Expand Down
Loading

0 comments on commit dc6aac7

Please sign in to comment.