All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.it.unibo.tuprolog.solve.TestClause.kt Maven / Gradle / Ivy

There is a newer version: 1.0.4
Show newest version
package it.unibo.tuprolog.solve

interface TestClause : SolverTest {
    companion object {
        fun prototype(solverFactory: SolverFactory): TestClause = TestClauseImpl(solverFactory)
    }

    /**
     * Tests the queries
     * ```prolog
     * ?- clause(x,Body).
     * ```
     * fails on a solver initialized with default built-ins and with and empty theory,
     */
    fun testClauseXBody()

    /**
     * Tests the queries
     * ```prolog
     * ?- clause(_,B).
     * ```
     * fails on a solver initialized with default built-ins and with and empty theory,
     * producing exception `instantiation_error`.
     */
    fun testClauseAnyB()

    /**
     * Tests the queries
     * ```prolog
     * ?- clause(4,B).
     * ```
     * fails on a solver initialized with default built-ins and with and empty theory,
     * producing exception `type_error(callable,4)`.
     */
    fun testClauseNumB()

    /**
     * Tests the queries
     * ```prolog
     * ?- clause(f(_),5).
     * ```
     * fails on a solver initialized with default built-ins and with and empty theory,
     * producing exception `type_error(callable,5)`.
     */
    fun testClauseFAnyNum()

    /**
     * Tests the queries
     * ```prolog
     * ?- clause(atom(_),Body).
     * ```
     * fails on a solver initialized with default built-ins and with and empty theory,
     * producing exception `permission_error(access,private_procedure,atom/1)`.
     */
    fun testClauseAtomBody()

    /**
     * Tests the queries
     * ```prolog
     * f(X) :- g(X).
     * ?- clause(f(A),B).
     * ```
     * succeeds in such a way that `B=g(A)`, whereas
     * ```
     * ?- clause(f(1), Z).
     * ```
     * succeeds in such a way that `Z=g(1)`
     */
    fun testClauseVariables()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy