diff --git a/dsl-core/src/commonMain/kotlin/it/unibo/tuprolog/dsl/PrologStdLibScope.kt b/dsl-core/src/commonMain/kotlin/it/unibo/tuprolog/dsl/PrologStdLibScope.kt index f3cdceea5..87922044b 100644 --- a/dsl-core/src/commonMain/kotlin/it/unibo/tuprolog/dsl/PrologStdLibScope.kt +++ b/dsl-core/src/commonMain/kotlin/it/unibo/tuprolog/dsl/PrologStdLibScope.kt @@ -134,38 +134,29 @@ interface PrologStdLibScope : PrologAwareScope { infix fun Any.univ(other: Any): Struct = structOf("=..", this.toTerm(), other.toTerm()) @JsName("eq2") - infix fun Any.`=`(right: Any): Struct = + infix fun Any.eq(right: Any): Struct = structOf("=", this.toTerm(), right.toTerm()) @JsName("neq2") - infix fun Any.`!=`(right: Any): Struct = + infix fun Any.neq(right: Any): Struct = structOf("\\=", this.toTerm(), right.toTerm()) @JsName("id2") - infix fun Any.`==`(right: Any): Struct = + infix fun Any.id(right: Any): Struct = structOf("==", this.toTerm(), right.toTerm()) @JsName("nid2") - infix fun Any.`!==`(right: Any): Struct = + infix fun Any.nid(right: Any): Struct = structOf("\\==", this.toTerm(), right.toTerm()) @JsName("arithEq2") - infix fun Any.`===`(right: Any): Struct = + infix fun Any.arithEq(right: Any): Struct = structOf("=:=", this.toTerm(), right.toTerm()) @JsName("arithNeq2") - infix fun Any.`=!=`(right: Any): Struct = + infix fun Any.arithNeq(right: Any): Struct = structOf("=\\=", this.toTerm(), right.toTerm()) - @Suppress("DANGEROUS_CHARACTERS") - @JsName("power") - infix fun Any.`**`(right: Any): Struct = - structOf("**", this.toTerm(), right.toTerm()) - - @JsName("pow") - infix fun Any.`^`(right: Any): Struct = - structOf("^", this.toTerm(), right.toTerm()) - @JsName("member2") fun member(item: Any, list: Any): Struct = structOf("member", item.toTerm(), list.toTerm()) diff --git a/dsl-solve/src/commonTest/kotlin/it/unibo/tuprolog/dsl/solve/TestNQueens.kt b/dsl-solve/src/commonTest/kotlin/it/unibo/tuprolog/dsl/solve/TestNQueens.kt index ae4d2608a..4eae1af1e 100644 --- a/dsl-solve/src/commonTest/kotlin/it/unibo/tuprolog/dsl/solve/TestNQueens.kt +++ b/dsl-solve/src/commonTest/kotlin/it/unibo/tuprolog/dsl/solve/TestNQueens.kt @@ -17,10 +17,10 @@ class TestNQueens { staticKb( rule { "no_attack"(("X1" and "Y1"), ("X2" and "Y2")) `if` ( - ("X1" `=!=` "X2") and - ("Y1" `=!=` "Y2") and - (("Y2" - "Y1") `=!=` ("X2" - "X1")) and - (("Y2" - "Y1") `=!=` ("X1" - "X2")) + ("X1" arithNeq "X2") and + ("Y1" arithNeq "Y2") and + (("Y2" - "Y1") arithNeq ("X2" - "X1")) and + (("Y2" - "Y1") arithNeq ("X1" - "X2")) ) }, fact { "no_attack_all"(`_`, emptyList) }, diff --git a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestAndImpl.kt b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestAndImpl.kt index 6e9ede6ae..e384340e9 100644 --- a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestAndImpl.kt +++ b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestAndImpl.kt @@ -11,7 +11,7 @@ internal class TestAndImpl(private val solverFactory: SolverFactory) : TestAnd { prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = "X" `=` 1 and `var`("X") + val query = "X" eq 1 and `var`("X") val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -25,7 +25,7 @@ internal class TestAndImpl(private val solverFactory: SolverFactory) : TestAnd { prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = `var`("X") and ("X" `=` 1) + val query = `var`("X") and ("X" eq 1) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -76,7 +76,7 @@ internal class TestAndImpl(private val solverFactory: SolverFactory) : TestAnd { prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = "X" `=` true and call("X") + val query = "X" eq true and call("X") val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( diff --git a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestArithImpl.kt b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestArithImpl.kt index d4ec45e59..184e15a9e 100644 --- a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestArithImpl.kt +++ b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestArithImpl.kt @@ -12,7 +12,7 @@ internal class TestArithImpl(private val solverFactory: SolverFactory) : TestAri prolog { val solver = solverFactory.solverWithDefaultBuiltins() - var query = 0 `=!=` 1 + var query = 0 arithNeq 1 var solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -20,7 +20,7 @@ internal class TestArithImpl(private val solverFactory: SolverFactory) : TestAri solutions ) - query = 1.0 `=!=` 1 + query = 1.0 arithNeq 1 solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -28,7 +28,7 @@ internal class TestArithImpl(private val solverFactory: SolverFactory) : TestAri solutions ) - query = (numOf(3) * 2) `=!=` (numOf(7) - 1) + query = (numOf(3) * 2) arithNeq (numOf(7) - 1) solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -36,7 +36,7 @@ internal class TestArithImpl(private val solverFactory: SolverFactory) : TestAri solutions ) - query = "N" `=!=` 5 + query = "N" arithNeq 5 solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -53,7 +53,7 @@ internal class TestArithImpl(private val solverFactory: SolverFactory) : TestAri solutions ) - query = "floot"(1) `=!=` 5 + query = "floot"(1) arithNeq 5 solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -77,7 +77,7 @@ internal class TestArithImpl(private val solverFactory: SolverFactory) : TestAri prolog { val solver = solverFactory.solverWithDefaultBuiltins() - var query = 0 `===` 1 + var query = 0 arithEq 1 var solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -85,7 +85,7 @@ internal class TestArithImpl(private val solverFactory: SolverFactory) : TestAri solutions ) - query = 1.0 `===` 1 + query = 1.0 arithEq 1 solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -93,7 +93,7 @@ internal class TestArithImpl(private val solverFactory: SolverFactory) : TestAri solutions ) - query = (numOf(3) * 2) `===` (numOf(7) - 1) + query = (numOf(3) * 2) arithEq (numOf(7) - 1) solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -101,7 +101,7 @@ internal class TestArithImpl(private val solverFactory: SolverFactory) : TestAri solutions ) - query = "N" `===` 5 + query = "N" arithEq 5 solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -118,7 +118,7 @@ internal class TestArithImpl(private val solverFactory: SolverFactory) : TestAri solutions ) - query = "floot"(1) `===` 5 + query = "floot"(1) arithEq 5 solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -136,7 +136,7 @@ internal class TestArithImpl(private val solverFactory: SolverFactory) : TestAri solutions ) - query = 0.333 `===` (numOf(1) / 3) + query = 0.333 arithEq (numOf(1) / 3) solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( diff --git a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestBagOfImpl.kt b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestBagOfImpl.kt index 874d0bef0..8aad701b8 100644 --- a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestBagOfImpl.kt +++ b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestBagOfImpl.kt @@ -9,7 +9,7 @@ class TestBagOfImpl(private val solverFactory: SolverFactory) : TestBagOf { override fun testBagXInDifferentValues() { prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = bagof("X", ("X" `=` 1) or ("X" `=` 2), "S") + val query = bagof("X", ("X" eq 1) or ("X" eq 2), "S") val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -23,7 +23,7 @@ class TestBagOfImpl(private val solverFactory: SolverFactory) : TestBagOf { prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = bagof("X", ("X" `=` 1) or ("X" `=` 2), "X") + val query = bagof("X", ("X" eq 1) or ("X" eq 2), "X") val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -37,7 +37,7 @@ class TestBagOfImpl(private val solverFactory: SolverFactory) : TestBagOf { prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = bagof("X", ("X" `=` "Y") or ("X" `=` "Z"), "L") + val query = bagof("X", ("X" eq "Y") or ("X" eq "Z"), "L") val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -65,7 +65,7 @@ class TestBagOfImpl(private val solverFactory: SolverFactory) : TestBagOf { prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = bagof("X", "Y" `^` (("X" `=` 1) or ("Y" `=` 2)), "S") + val query = bagof("X", "Y" sup (("X" eq 1) or ("Y" eq 2)), "S") val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( diff --git a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestFindAllImpl.kt b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestFindAllImpl.kt index c23226ae6..a82c812f5 100644 --- a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestFindAllImpl.kt +++ b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestFindAllImpl.kt @@ -14,7 +14,7 @@ internal class TestFindAllImpl( prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = findall("X", ("X" `=` 1) or ("X" `=` 2), "S") + val query = findall("X", ("X" eq 1) or ("X" eq 2), "S") val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -28,7 +28,7 @@ internal class TestFindAllImpl( prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = findall("+"("X", "Y"), "X" `=` 1, "S") + val query = findall("+"("X", "Y"), "X" eq 1, "S") val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -56,7 +56,7 @@ internal class TestFindAllImpl( prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = findall("X", ("X" `=` 1) or ("X" `=` 1), "S") + val query = findall("X", ("X" eq 1) or ("X" eq 1), "S") val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -70,7 +70,7 @@ internal class TestFindAllImpl( prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = findall("X", ("X" `=` 2) or ("X" `=` 1), listOf(1, 2)) + val query = findall("X", ("X" eq 2) or ("X" eq 1), listOf(1, 2)) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -84,7 +84,7 @@ internal class TestFindAllImpl( prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = findall("X", ("X" `=` 1) or ("X" `=` 2), listOf("X", "Y")) + val query = findall("X", ("X" eq 1) or ("X" eq 2), listOf("X", "Y")) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( diff --git a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestIfThenElseImpl.kt b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestIfThenElseImpl.kt index b65887970..a12ea55df 100644 --- a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestIfThenElseImpl.kt +++ b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestIfThenElseImpl.kt @@ -63,7 +63,7 @@ internal class TestIfThenElseImpl(private val solverFactory: SolverFactory) : Te prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = ";"("->"(true, ("X" `=` 1)), "X" `=` 2) + val query = ";"("->"(true, ("X" eq 1)), "X" eq 2) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -77,7 +77,7 @@ internal class TestIfThenElseImpl(private val solverFactory: SolverFactory) : Te prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = ";"("->"(fail, ("X" `=` 1)), "X" `=` 2) + val query = ";"("->"(fail, ("X" eq 1)), "X" eq 2) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -91,7 +91,7 @@ internal class TestIfThenElseImpl(private val solverFactory: SolverFactory) : Te prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = ";"("->"(true, ("X" `=` 1) or ("X" `=` 2)), true) + val query = ";"("->"(true, ("X" eq 1) or ("X" eq 2)), true) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -110,7 +110,7 @@ internal class TestIfThenElseImpl(private val solverFactory: SolverFactory) : Te prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = ";"("->"(("X" `=` 1) or ("X" `=` 2), true), true) + val query = ";"("->"(("X" eq 1) or ("X" eq 2), true), true) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( diff --git a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestIfThenImpl.kt b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestIfThenImpl.kt index 65dfe452d..7f5ea4a1e 100644 --- a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestIfThenImpl.kt +++ b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestIfThenImpl.kt @@ -49,7 +49,7 @@ internal class TestIfThenImpl(private val solverFactory: SolverFactory) : TestIf prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = "->"(true, "X" `=` 1) + val query = "->"(true, "X" eq 1) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -63,7 +63,7 @@ internal class TestIfThenImpl(private val solverFactory: SolverFactory) : TestIf prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = "->"(("X" `=` 1) or ("X" `=` 2), true) + val query = "->"(("X" eq 1) or ("X" eq 2), true) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -77,7 +77,7 @@ internal class TestIfThenImpl(private val solverFactory: SolverFactory) : TestIf prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = "->"(true, ("X" `=` 1) or ("X" `=` 2)) + val query = "->"(true, ("X" eq 1) or ("X" eq 2)) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( diff --git a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestIsImpl.kt b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestIsImpl.kt index e01ac2de7..6d38ba3fa 100644 --- a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestIsImpl.kt +++ b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestIsImpl.kt @@ -23,7 +23,7 @@ internal class TestIsImpl(private val solverFactory: SolverFactory) : TestIs { prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = ("X" `=` (intOf(1) + intOf(2))) and ("Y" `is` ("X" * intOf(3))) + val query = ("X" eq (intOf(1) + intOf(2))) and ("Y" `is` ("X" * intOf(3))) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( diff --git a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestNonVarImpl.kt b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestNonVarImpl.kt index 22590f930..9a59961f4 100644 --- a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestNonVarImpl.kt +++ b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestNonVarImpl.kt @@ -51,7 +51,7 @@ internal class TestNonVarImpl(private val solverFactory: SolverFactory) : TestNo prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = ("foo" `=` "Foo") and nonvar("Foo") + val query = ("foo" eq "Foo") and nonvar("Foo") val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( diff --git a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestNotProvableImpl.kt b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestNotProvableImpl.kt index f9bcc3836..fd3eef1ec 100644 --- a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestNotProvableImpl.kt +++ b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestNotProvableImpl.kt @@ -60,7 +60,7 @@ class TestNotProvableImpl( prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = ((("X" `=` 1) or ("X" `=` 2)) and "not"(("!" and fail))) + val query = ((("X" eq 1) or ("X" eq 2)) and "not"(("!" and fail))) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -79,7 +79,7 @@ class TestNotProvableImpl( prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = "not"(4 `=` 5) + val query = "not"(4 eq 5) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( diff --git a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestOnceImpl.kt b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestOnceImpl.kt index 78a90c46c..3b3a35b0d 100644 --- a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestOnceImpl.kt +++ b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestOnceImpl.kt @@ -26,7 +26,7 @@ internal class TestOnceImpl( prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = ("once"("!") and (("X" `=` 1) or ("X" `=` 2))) + val query = ("once"("!") and (("X" eq 1) or ("X" eq 2))) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( diff --git a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestOrImpl.kt b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestOrImpl.kt index 6be46c30a..df985e7db 100644 --- a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestOrImpl.kt +++ b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestOrImpl.kt @@ -58,8 +58,8 @@ internal class TestOrImpl(private val solverFactory: SolverFactory) : TestOr { prolog { val solver = solverFactory.solverWithDefaultBuiltins() -// val query = ";"(("X" `=` 1 and "!"), "X" `=` 2) - val query = ("X" `=` 1 and "!") or ("X" `=` 2) +// val query = ";"(("X" eq 1 and "!"), "X" eq 2) + val query = ("X" eq 1 and "!") or ("X" eq 2) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -73,8 +73,8 @@ internal class TestOrImpl(private val solverFactory: SolverFactory) : TestOr { prolog { val solver = solverFactory.solverWithDefaultBuiltins() -// val query = ";"("X" `=` 1, "X" `=` 2) - val query = ("X" `=` 1) or ("X" `=` 2) +// val query = ";"("X" eq 1, "X" eq 2) + val query = ("X" eq 1) or ("X" eq 2) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( diff --git a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestRetractImpl.kt b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestRetractImpl.kt index 4daf57dac..aaf0eb47b 100644 --- a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestRetractImpl.kt +++ b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestRetractImpl.kt @@ -33,7 +33,7 @@ internal class TestRetractImpl(private val solverFactory: SolverFactory) : TestR prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = retract((atom(`_`) `if` ("X" `==` emptyList))) + val query = retract((atom(`_`) `if` ("X" id emptyList))) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( diff --git a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestSetOfImpl.kt b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestSetOfImpl.kt index 494a0d215..694b4d24a 100644 --- a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestSetOfImpl.kt +++ b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestSetOfImpl.kt @@ -8,7 +8,7 @@ class TestSetOfImpl(private val solverFactory: SolverFactory) : TestSetOf { prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = setof("X", ("X" `=` 1) or ("X" `=` 2), "S") + val query = setof("X", ("X" eq 1) or ("X" eq 2), "S") val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -22,7 +22,7 @@ class TestSetOfImpl(private val solverFactory: SolverFactory) : TestSetOf { prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = setof("X", ("X" `=` 1) or ("X" `=` 2), "X") + val query = setof("X", ("X" eq 1) or ("X" eq 2), "X") val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -36,7 +36,7 @@ class TestSetOfImpl(private val solverFactory: SolverFactory) : TestSetOf { prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = setof("X", ("X" `=` 2) or ("X" `=` 1), "X") + val query = setof("X", ("X" eq 2) or ("X" eq 1), "X") val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -50,7 +50,7 @@ class TestSetOfImpl(private val solverFactory: SolverFactory) : TestSetOf { prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = setof("X", ("X" `=` 2) or ("X" `=` 2), "L") + val query = setof("X", ("X" eq 2) or ("X" eq 2), "L") val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -78,7 +78,7 @@ class TestSetOfImpl(private val solverFactory: SolverFactory) : TestSetOf { prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = setof("X", "Y" `^` ((("X" `=` 1) or ("Y" `=` 1)) or (("X" `=` 2) or ("Y" `=` 2))), "S") + val query = setof("X", "Y" sup ((("X" eq 1) or ("Y" eq 1)) or (("X" eq 2) or ("Y" eq 2))), "S") val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( diff --git a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestUnifyImpl.kt b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestUnifyImpl.kt index 8bcead13c..f78d1c3a7 100644 --- a/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestUnifyImpl.kt +++ b/test-solve/src/commonMain/kotlin/it/unibo/tuprolog/solve/TestUnifyImpl.kt @@ -9,7 +9,7 @@ internal class TestUnifyImpl(private val solverFactory: SolverFactory) : TestUni prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = 1 `=` 1 + val query = 1 eq 1 val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -23,7 +23,7 @@ internal class TestUnifyImpl(private val solverFactory: SolverFactory) : TestUni prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = "X" `=` 1 + val query = "X" eq 1 val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -37,7 +37,7 @@ internal class TestUnifyImpl(private val solverFactory: SolverFactory) : TestUni prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = "X" `=` "Y" + val query = "X" eq "Y" val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -51,7 +51,7 @@ internal class TestUnifyImpl(private val solverFactory: SolverFactory) : TestUni prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = (("X" `=` "Y") and ("X" `=` "abc")) + val query = (("X" eq "Y") and ("X" eq "abc")) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -65,7 +65,7 @@ internal class TestUnifyImpl(private val solverFactory: SolverFactory) : TestUni prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = "f"("X", "def") `=` "f"("def", "Y") + val query = "f"("X", "def") eq "f"("def", "Y") val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -79,7 +79,7 @@ internal class TestUnifyImpl(private val solverFactory: SolverFactory) : TestUni prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = 1 `=` 2 + val query = 1 eq 2 val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -93,7 +93,7 @@ internal class TestUnifyImpl(private val solverFactory: SolverFactory) : TestUni prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = 1 `=` realOf(1.0) + val query = 1 eq realOf(1.0) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -107,7 +107,7 @@ internal class TestUnifyImpl(private val solverFactory: SolverFactory) : TestUni prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = ("g"("X")) `=` ("f"("a"("X"))) + val query = ("g"("X")) eq ("f"("a"("X"))) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -121,7 +121,7 @@ internal class TestUnifyImpl(private val solverFactory: SolverFactory) : TestUni prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = ("f"("X", 1)) `=` ("f"("a"("X"))) + val query = ("f"("X", 1)) eq ("f"("a"("X"))) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -135,7 +135,7 @@ internal class TestUnifyImpl(private val solverFactory: SolverFactory) : TestUni prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = ("f"("X", "Y", "X")) `=` ("f"("a"("X"), "a"("Y"), "Y", 2)) + val query = ("f"("X", "Y", "X")) eq ("f"("a"("X"), "a"("Y"), "Y", 2)) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals( @@ -149,7 +149,7 @@ internal class TestUnifyImpl(private val solverFactory: SolverFactory) : TestUni prolog { val solver = solverFactory.solverWithDefaultBuiltins() - val query = ("f"("A", "B", "C")) `=` ("f"("g"("B", "B"), "g"("C", "C"), "g"("D", "D"))) + val query = ("f"("A", "B", "C")) eq ("f"("g"("B", "B"), "g"("C", "C"), "g"("D", "D"))) val solutions = solver.solve(query, mediumDuration).toList() assertSolutionEquals(