commonMain.it.unibo.tuprolog.solve.TestOnce.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of test-solve-js Show documentation
Show all versions of test-solve-js Show documentation
"Multi-platform Prolog environment, in Kotlin"
package it.unibo.tuprolog.solve
interface TestOnce : SolverTest {
companion object {
fun prototype(solverFactory: SolverFactory): TestOnce =
TestOnceImpl(solverFactory)
}
/**
* Tests the queries
* ```prolog
* ?- once(!).
* ```
* succeeds on a solver initialized with default built-ins and with and empty theory.
*/
fun testOnceCut()
/**
* Tests the queries
* ```prolog
* ?- (once(!), (X=1; X=2)).
* ```
* succeeds on a solver initialized with default built-ins and with and empty theory,
* producing 2 solutions which binds variable `X` to `1` and `X` to `2`.
*/
fun testOnceCutOr()
/**
* Tests the queries
* ```prolog
* ?- once(repeat).
* ```
* succeeds on a solver initialized with default built-ins and with and empty theory.
*/
fun testOnceRepeat()
/**
* Tests the queries
* ```prolog
* ?- once(fail).
* ```
* fails on a solver initialized with default built-ins and with and empty theory.
*/
fun testOnceFail()
/**
* Tests the queries
* ```prolog
* ?- once(3).
* ```
* fails on a solver initialized with default built-ins and with and empty theory,
* producing exception `type_error(callable/3)`.
*/
fun testOnceNum()
/**
* Tests the queries
* ```prolog
* ?- once(X).
* ```
* fails on a solver initialized with default built-ins and with and empty theory,
* producing exception `instantiation_error`.
*/
fun testOnceX()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy