From 63c33961a120b2d103e67f6cc8a0a42316e4601e Mon Sep 17 00:00:00 2001 From: Giovanni Date: Mon, 14 Sep 2020 15:05:33 +0200 Subject: [PATCH] format code in :solve-classic --- .../tuprolog/solve/ChoicePointContext.kt | 20 +++++----- .../tuprolog/solve/ClassicExecutionContext.kt | 39 +++++++++++-------- .../it/unibo/tuprolog/solve/ClassicSolver.kt | 1 - .../tuprolog/solve/ClassicSolverFactory.kt | 2 +- .../tuprolog/solve/MutableClassicSolver.kt | 3 +- .../unibo/tuprolog/solve/SolutionIterator.kt | 2 +- .../unibo/tuprolog/solve/SolverExtensions.kt | 3 +- .../tuprolog/solve/fsm/AbstractEndState.kt | 2 +- .../unibo/tuprolog/solve/fsm/AbstractState.kt | 1 - .../it/unibo/tuprolog/solve/fsm/EndState.kt | 2 +- .../tuprolog/solve/fsm/ExceptionalState.kt | 2 +- .../it/unibo/tuprolog/solve/fsm/State.kt | 2 - .../tuprolog/solve/fsm/StateBacktracking.kt | 2 +- .../it/unibo/tuprolog/solve/fsm/StateEnd.kt | 2 +- .../tuprolog/solve/fsm/StateException.kt | 3 +- .../tuprolog/solve/fsm/StateGoalSelection.kt | 3 +- .../it/unibo/tuprolog/solve/fsm/StateHalt.kt | 5 ++- .../it/unibo/tuprolog/solve/fsm/StateInit.kt | 2 +- .../solve/fsm/StatePrimitiveExecution.kt | 4 +- .../solve/fsm/StatePrimitiveSelection.kt | 4 +- .../tuprolog/solve/fsm/StateRuleExecution.kt | 2 +- .../tuprolog/solve/fsm/StateRuleSelection.kt | 31 ++++++++------- .../it/unibo/tuprolog/solve/fsm/Utils.kt | 15 +++++-- .../tuprolog/solve/stdlib/DefaultBuiltins.kt | 2 +- .../tuprolog/solve/stdlib/primitive/Throw.kt | 4 +- .../unibo/tuprolog/solve/stdlib/rule/Call.kt | 2 +- .../unibo/tuprolog/solve/stdlib/rule/Catch.kt | 2 +- .../unibo/tuprolog/solve/stdlib/rule/Comma.kt | 2 +- .../unibo/tuprolog/solve/stdlib/rule/Cut.kt | 2 +- .../solve/stdlib/rule/NegationAsFailure.kt | 2 +- .../solve/stdlib/rule/SpecificRules.kt | 2 +- .../solve/systemtest/TestClassicAbolish.kt | 3 +- .../solve/systemtest/TestClassicAnd.kt | 13 ++----- .../solve/systemtest/TestClassicArg.kt | 39 ++++++++----------- .../solve/systemtest/TestClassicArith.kt | 12 ++---- .../solve/systemtest/TestClassicAssertA.kt | 4 +- .../solve/systemtest/TestClassicAssertZ.kt | 4 +- .../solve/systemtest/TestClassicAtom.kt | 23 +++++------ .../solve/systemtest/TestClassicAtomic.kt | 21 ++++------ .../solve/systemtest/TestClassicCall.kt | 7 ++-- .../systemtest/TestClassicCatchAndThrow.kt | 4 +- .../solve/systemtest/TestClassicClause.kt | 5 +-- .../solve/systemtest/TestClassicCompound.kt | 4 +- .../solve/systemtest/TestClassicCopyTerm.kt | 5 +-- .../solve/systemtest/TestClassicCut.kt | 4 +- .../solve/systemtest/TestClassicFail.kt | 5 +-- .../solve/systemtest/TestClassicFindAll.kt | 27 ++++++------- .../solve/systemtest/TestClassicFloat.kt | 4 +- .../solve/systemtest/TestClassicFunctor.kt | 7 ++-- .../solve/systemtest/TestClassicIfThen.kt | 4 +- .../solve/systemtest/TestClassicIfThenElse.kt | 4 +- .../solve/systemtest/TestClassicInteger.kt | 13 ++----- .../solve/systemtest/TestClassicIs.kt | 6 +-- .../solve/systemtest/TestClassicNonVar.kt | 13 ++----- .../systemtest/TestClassicNotProvable.kt | 5 +-- .../solve/systemtest/TestClassicNotUnify.kt | 14 ++----- .../solve/systemtest/TestClassicNumber.kt | 3 +- .../solve/systemtest/TestClassicOnce.kt | 5 +-- .../solve/systemtest/TestClassicOr.kt | 15 ++----- .../solve/systemtest/TestClassicRepeat.kt | 4 +- .../solve/systemtest/TestClassicRetract.kt | 5 +-- .../solve/systemtest/TestClassicSolver.kt | 5 ++- .../solve/systemtest/TestClassicTerm.kt | 3 +- .../solve/systemtest/TestClassicTrue.kt | 4 +- .../solve/systemtest/TestClassicUnify.kt | 14 ++----- 65 files changed, 207 insertions(+), 271 deletions(-) diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/ChoicePointContext.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/ChoicePointContext.kt index 80d163da5..47dad63d2 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/ChoicePointContext.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/ChoicePointContext.kt @@ -45,15 +45,15 @@ sealed class ChoicePointContext( get() = executionContext?.procedure override fun toString(): String = "$typeName(" + - "alternatives=$alternatives, " + - if (executionContext === null) { - "executionContext=${executionContext}, " - } else { - "executionContextDepth=${executionContextDepth}, " - "executionContextProcedure=${executionContextProcedure}, " - } + - "depth=$depth" + - ")" + "alternatives=$alternatives, " + + if (executionContext === null) { + "executionContext=$executionContext, " + } else { + "executionContextDepth=$executionContextDepth, " + "executionContextProcedure=$executionContextProcedure, " + } + + "depth=$depth" + + ")" protected abstract val typeName: String @@ -144,4 +144,4 @@ fun ChoicePointContext?.appendPrimitives( fun ChoicePointContext?.appendRules( alternatives: Cursor, executionContext: ClassicExecutionContext? = null -): ChoicePointContext? = ChoicePointContext.Rules(alternatives, executionContext, this, nextDepth()) \ No newline at end of file +): ChoicePointContext? = ChoicePointContext.Rules(alternatives, executionContext, this, nextDepth()) diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/ClassicExecutionContext.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/ClassicExecutionContext.kt index ee98d3958..0c81faced 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/ClassicExecutionContext.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/ClassicExecutionContext.kt @@ -1,6 +1,11 @@ package it.unibo.tuprolog.solve -import it.unibo.tuprolog.core.* +import it.unibo.tuprolog.core.Rule +import it.unibo.tuprolog.core.Struct +import it.unibo.tuprolog.core.Substitution +import it.unibo.tuprolog.core.Term +import it.unibo.tuprolog.core.Truth +import it.unibo.tuprolog.core.Var import it.unibo.tuprolog.core.operators.OperatorSet import it.unibo.tuprolog.solve.channel.InputChannel import it.unibo.tuprolog.solve.channel.OutputChannel @@ -125,20 +130,20 @@ data class ClassicExecutionContext( override fun toString(): String { return "ClassicExecutionContext(" + - "query=$query, " + - "procedure=$procedure, " + - "substitution=$substitution, " + - "goals=$goals, " + - "rules=$rules, " + - "primitives=$primitives, " + - "startTime=$startTime, " + - "operators=${operators.joinToString(",", "{", "}") { "'${it.functor}':${it.specifier}" }}, " + - "inputChannels=${inputChannels.keys}, " + - "outputChannels=${outputChannels.keys}, " + - "maxDuration=$maxDuration, " + - "choicePoints=$choicePoints, " + - "depth=$depth, " + - "step=$step" + - ")" + "query=$query, " + + "procedure=$procedure, " + + "substitution=$substitution, " + + "goals=$goals, " + + "rules=$rules, " + + "primitives=$primitives, " + + "startTime=$startTime, " + + "operators=${operators.joinToString(",", "{", "}") { "'${it.functor}':${it.specifier}" }}, " + + "inputChannels=${inputChannels.keys}, " + + "outputChannels=${outputChannels.keys}, " + + "maxDuration=$maxDuration, " + + "choicePoints=$choicePoints, " + + "depth=$depth, " + + "step=$step" + + ")" } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/ClassicSolver.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/ClassicSolver.kt index 5c547f580..f3f7bd63e 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/ClassicSolver.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/ClassicSolver.kt @@ -57,7 +57,6 @@ internal open class ClassicSolver( require(newState.context.step == newStep) state = newState }.asSequence() - } override val libraries: Libraries diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/ClassicSolverFactory.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/ClassicSolverFactory.kt index 567705c7e..c55aa2d11 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/ClassicSolverFactory.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/ClassicSolverFactory.kt @@ -54,4 +54,4 @@ object ClassicSolverFactory : SolverFactory { mapOf(STDIN to stdIn), mapOf(STDOUT to stdOut, STDERR to stdErr, WARNINGS to warnings) ) -} \ No newline at end of file +} diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/MutableClassicSolver.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/MutableClassicSolver.kt index e7943ce2d..bb2f42115 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/MutableClassicSolver.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/MutableClassicSolver.kt @@ -125,5 +125,4 @@ internal class MutableClassicSolver( } return result } - -} \ No newline at end of file +} diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/SolutionIterator.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/SolutionIterator.kt index 7a8726ca4..0365e71fe 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/SolutionIterator.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/SolutionIterator.kt @@ -42,4 +42,4 @@ internal class SolutionIterator( private fun Substitution.Unifier.cleanUp(toRetain: Set): Substitution.Unifier { return filter { _, term -> (term !is Var) || (term in toRetain) } } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/SolverExtensions.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/SolverExtensions.kt index 7ad672561..d2e483d0a 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/SolverExtensions.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/SolverExtensions.kt @@ -1,4 +1,5 @@ @file:JvmName("SolverExtensions") + package it.unibo.tuprolog.solve import it.unibo.tuprolog.solve.channel.InputChannel @@ -59,4 +60,4 @@ fun MutableSolver.Companion.classicWithDefaultBuiltins( stdErr: OutputChannel = ClassicSolverFactory.defaultErrorChannel, warnings: OutputChannel = ClassicSolverFactory.defaultWarningsChannel ): MutableSolver = - ClassicSolverFactory.mutableSolverWithDefaultBuiltins(libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings) \ No newline at end of file + ClassicSolverFactory.mutableSolverWithDefaultBuiltins(libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings) diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/AbstractEndState.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/AbstractEndState.kt index be40bab8e..de4df544b 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/AbstractEndState.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/AbstractEndState.kt @@ -9,4 +9,4 @@ internal abstract class AbstractEndState( ) : EndState, AbstractState(context) { override fun computeNext(): State = throw NoSuchElementException() -} \ No newline at end of file +} diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/AbstractState.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/AbstractState.kt index 35993cb9e..939049f68 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/AbstractState.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/AbstractState.kt @@ -39,4 +39,3 @@ internal abstract class AbstractState(override val context: ClassicExecutionCont protected fun previousDepth(): Int = context.depth - 1 } - diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/EndState.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/EndState.kt index 315383f96..73f01da4e 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/EndState.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/EndState.kt @@ -8,4 +8,4 @@ interface EndState : State { val hasOpenAlternatives: Boolean get() = solution is Solution.Yes && context.hasOpenAlternatives -} \ No newline at end of file +} diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/ExceptionalState.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/ExceptionalState.kt index 8c8a73887..74afd73e6 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/ExceptionalState.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/ExceptionalState.kt @@ -4,4 +4,4 @@ import it.unibo.tuprolog.solve.exception.TuPrologRuntimeException interface ExceptionalState : State { val exception: TuPrologRuntimeException -} \ No newline at end of file +} diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/State.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/State.kt index 9e1f8a3ab..949d4a60e 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/State.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/State.kt @@ -22,5 +22,3 @@ fun State.clone(context: ClassicExecutionContext = this.context): State = is StateRuleSelection -> copy(context) else -> throw IllegalStateException() } - - diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateBacktracking.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateBacktracking.kt index 5b9732016..e238d79f4 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateBacktracking.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateBacktracking.kt @@ -21,4 +21,4 @@ internal data class StateBacktracking(override val context: ClassicExecutionCont } } } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateEnd.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateEnd.kt index 12dcb2513..4ad2595c6 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateEnd.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateEnd.kt @@ -18,4 +18,4 @@ internal data class StateEnd( super.computeNext() } } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateException.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateException.kt index 86fb0f8a5..4a25c44a9 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateException.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateException.kt @@ -83,5 +83,4 @@ internal data class StateException( else -> finalState } } - -} \ No newline at end of file +} diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateGoalSelection.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateGoalSelection.kt index b491e3fcc..b449a6878 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateGoalSelection.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateGoalSelection.kt @@ -5,7 +5,6 @@ import it.unibo.tuprolog.solve.Solution internal data class StateGoalSelection(override val context: ClassicExecutionContext) : AbstractState(context) { override fun computeNext(): State { - return if (context.goals.isOver) { if (context.isRoot) { StateEnd( @@ -44,4 +43,4 @@ internal data class StateGoalSelection(override val context: ClassicExecutionCon ) } } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateHalt.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateHalt.kt index 511e94860..249711acf 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateHalt.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateHalt.kt @@ -8,5 +8,6 @@ internal data class StateHalt( override val exception: TuPrologRuntimeException, override val context: ClassicExecutionContext ) : ExceptionalState, AbstractEndState( - Solution.Halt(context.query, exception), context -) \ No newline at end of file + Solution.Halt(context.query, exception), + context +) diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateInit.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateInit.kt index 8e96aebca..02c88b6e9 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateInit.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateInit.kt @@ -20,4 +20,4 @@ internal data class StateInit(override val context: ClassicExecutionContext) : A ).appendRulesAndChoicePoints(Cursor.empty()) ) } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StatePrimitiveExecution.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StatePrimitiveExecution.kt index 1e6b44b8a..2d2a4f273 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StatePrimitiveExecution.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StatePrimitiveExecution.kt @@ -24,7 +24,6 @@ internal data class StatePrimitiveExecution(override val context: ClassicExecuti ) } - override fun computeNext(): State = try { when (val sol = context.primitives.current?.solution) { is Solution.Yes -> { @@ -55,5 +54,4 @@ internal data class StatePrimitiveExecution(override val context: ClassicExecuti context.copy(step = nextStep()) ) } - -} \ No newline at end of file +} diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StatePrimitiveSelection.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StatePrimitiveSelection.kt index 485a098e6..82980403f 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StatePrimitiveSelection.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StatePrimitiveSelection.kt @@ -35,7 +35,6 @@ internal data class StatePrimitiveSelection(override val context: ClassicExecuti val signature = goal.extractSignature() if (libraries.hasPrimitive(signature)) { - val req = toRequest(goal, signature) val primitive = libraries.primitives[signature] ?: error("Inconsistent behaviour of Library.contains and Library.get") @@ -69,5 +68,4 @@ internal data class StatePrimitiveSelection(override val context: ClassicExecuti } } } - -} \ No newline at end of file +} diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateRuleExecution.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateRuleExecution.kt index 6670a1424..941b9be52 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateRuleExecution.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateRuleExecution.kt @@ -30,4 +30,4 @@ internal data class StateRuleExecution(override val context: ClassicExecutionCon else -> failureState } } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateRuleSelection.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateRuleSelection.kt index 3763fa958..95aed388e 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateRuleSelection.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/StateRuleSelection.kt @@ -1,6 +1,10 @@ package it.unibo.tuprolog.solve.fsm -import it.unibo.tuprolog.core.* +import it.unibo.tuprolog.core.Atom +import it.unibo.tuprolog.core.Struct +import it.unibo.tuprolog.core.Term +import it.unibo.tuprolog.core.Truth +import it.unibo.tuprolog.core.Var import it.unibo.tuprolog.solve.ChoicePointContext import it.unibo.tuprolog.solve.ClassicExecutionContext import it.unibo.tuprolog.solve.Signature @@ -84,16 +88,16 @@ internal data class StateRuleSelection(override val context: ClassicExecutionCon private fun ClassicExecutionContext.computeCutLimit(magicCut: Boolean = false): CutLimit { val cutLimit = if (magicCut) { - this.pathToRoot.firstOrNull() - } else { - this.pathToRoot.firstOrNull { it.procedure?.extractSignature() !in transparentToCut } - } - return if (cutLimit == null) { - CutLimit.None - } else { - CutLimit.Actual(cutLimit.depth, cutLimit.procedure) - } + this.pathToRoot.firstOrNull() + } else { + this.pathToRoot.firstOrNull { it.procedure?.extractSignature() !in transparentToCut } + } + return if (cutLimit == null) { + CutLimit.None + } else { + CutLimit.Actual(cutLimit.depth, cutLimit.procedure) } + } private fun ChoicePointContext?.performCut(cutLimit: CutLimit): ChoicePointContext? { return when { @@ -101,8 +105,8 @@ internal data class StateRuleSelection(override val context: ClassicExecutionCon null } cutLimit is CutLimit.None || - cutLimit.depthToCut > executionContext!!.depth || - cutLimit.depthToCut == executionContext!!.depth && cutLimit.procedure != executionContext!!.procedure -> { + cutLimit.depthToCut > executionContext!!.depth || + cutLimit.depthToCut == executionContext!!.depth && cutLimit.procedure != executionContext!!.procedure -> { this } else -> { @@ -122,7 +126,6 @@ internal data class StateRuleSelection(override val context: ClassicExecutionCon } override fun computeNext(): State { - return when (val currentGoal = context.currentGoal!!) { is Var -> { exceptionalState( @@ -183,4 +186,4 @@ internal data class StateRuleSelection(override val context: ClassicExecutionCon } } } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/Utils.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/Utils.kt index 87a333f81..3686b66e2 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/Utils.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/fsm/Utils.kt @@ -1,12 +1,19 @@ package it.unibo.tuprolog.solve.fsm -import it.unibo.tuprolog.core.* -import it.unibo.tuprolog.solve.* +import it.unibo.tuprolog.core.Clause +import it.unibo.tuprolog.core.Rule +import it.unibo.tuprolog.core.Struct +import it.unibo.tuprolog.core.Term +import it.unibo.tuprolog.core.Tuple +import it.unibo.tuprolog.core.Var +import it.unibo.tuprolog.solve.ClassicExecutionContext +import it.unibo.tuprolog.solve.Signature +import it.unibo.tuprolog.solve.appendPrimitives +import it.unibo.tuprolog.solve.appendRules import it.unibo.tuprolog.solve.primitive.Solve import it.unibo.tuprolog.utils.Cursor import it.unibo.tuprolog.utils.cursor - fun Sequence.ensureRules(): Cursor = @Suppress("USELESS_CAST") map { require(it is Rule); it as Rule }.cursor() @@ -99,4 +106,4 @@ fun ClassicExecutionContext.toRequest( substitution = substitution ), executionMaxDuration = maxDuration - ) \ No newline at end of file + ) diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/DefaultBuiltins.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/DefaultBuiltins.kt index cd1ffb9fc..f16d571d3 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/DefaultBuiltins.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/DefaultBuiltins.kt @@ -18,4 +18,4 @@ object DefaultBuiltins : AliasedLibrary by CommonBuiltins { Throw ).map { it.descriptionPair }.toMap() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/primitive/Throw.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/primitive/Throw.kt index aafc65e92..d1147731f 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/primitive/Throw.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/primitive/Throw.kt @@ -3,10 +3,10 @@ package it.unibo.tuprolog.solve.stdlib.primitive import it.unibo.tuprolog.core.Struct import it.unibo.tuprolog.core.Term import it.unibo.tuprolog.solve.ExecutionContext -import it.unibo.tuprolog.solve.primitive.Solve import it.unibo.tuprolog.solve.exception.PrologError import it.unibo.tuprolog.solve.exception.TuPrologRuntimeException import it.unibo.tuprolog.solve.exception.error.MessageError +import it.unibo.tuprolog.solve.primitive.Solve import it.unibo.tuprolog.solve.primitive.UnaryPredicate object Throw : UnaryPredicate("throw") { @@ -30,4 +30,4 @@ object Throw : UnaryPredicate("throw") { ) ) } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/Call.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/Call.kt index 9e22b2270..65f202d47 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/Call.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/Call.kt @@ -17,4 +17,4 @@ object Call : RuleWrapper("call", 1) { structOf(EnsureExecutable.functor, varOf("G")), varOf("G") ) -} \ No newline at end of file +} diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/Catch.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/Catch.kt index 501c758a5..badeec0b9 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/Catch.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/Catch.kt @@ -13,4 +13,4 @@ object Catch : RuleWrapper("catch", 3) { override val Scope.body: Term get() = varOf("G") -} \ No newline at end of file +} diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/Comma.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/Comma.kt index d14c6c39d..71703c26b 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/Comma.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/Comma.kt @@ -13,4 +13,4 @@ object Comma : RuleWrapper(",", 2) { override val Scope.body: Term get() = tupleOf(varOf("A"), varOf("B")) -} \ No newline at end of file +} diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/Cut.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/Cut.kt index 81922a61e..425906960 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/Cut.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/Cut.kt @@ -3,4 +3,4 @@ package it.unibo.tuprolog.solve.stdlib.rule import it.unibo.tuprolog.solve.ExecutionContext import it.unibo.tuprolog.solve.rule.RuleWrapper -object Cut : RuleWrapper("!", 0) \ No newline at end of file +object Cut : RuleWrapper("!", 0) diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/NegationAsFailure.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/NegationAsFailure.kt index 90a159fa7..34db896c4 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/NegationAsFailure.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/NegationAsFailure.kt @@ -38,4 +38,4 @@ sealed class NegationAsFailure : RuleWrapper(FUNCTOR, ARITY) { const val ARITY: Int = 1 } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/SpecificRules.kt b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/SpecificRules.kt index f88d34a1f..d28d5dca6 100644 --- a/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/SpecificRules.kt +++ b/solve-classic/src/commonMain/kotlin/it/unibo/tuprolog/solve/stdlib/rule/SpecificRules.kt @@ -15,4 +15,4 @@ object SpecificRules { val theory: Theory = Theory.indexedOf( wrappers.map { it.wrappedImplementation } ) -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAbolish.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAbolish.kt index 89088e54f..62c33685e 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAbolish.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAbolish.kt @@ -3,7 +3,6 @@ package it.unibo.tuprolog.solve.systemtest import it.unibo.tuprolog.solve.ClassicSolverFactory import it.unibo.tuprolog.solve.SolverFactory import it.unibo.tuprolog.solve.TestAbolish -import kotlin.test.Ignore import kotlin.test.Test class TestClassicAbolish : TestAbolish, SolverFactory by ClassicSolverFactory { @@ -33,4 +32,4 @@ class TestClassicAbolish : TestAbolish, SolverFactory by ClassicSolverFactory { override fun testAbolish() { prototype.testAbolish() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAnd.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAnd.kt index 62610da5b..78f1f68b8 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAnd.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAnd.kt @@ -1,13 +1,8 @@ package it.unibo.tuprolog.solve.systemtest -import it.unibo.tuprolog.solve.* -import it.unibo.tuprolog.solve.channel.InputChannel -import it.unibo.tuprolog.solve.channel.OutputChannel -import it.unibo.tuprolog.solve.exception.PrologWarning -import it.unibo.tuprolog.solve.library.AliasedLibrary -import it.unibo.tuprolog.solve.library.Libraries -import it.unibo.tuprolog.solve.stdlib.DefaultBuiltins -import it.unibo.tuprolog.theory.Theory +import it.unibo.tuprolog.solve.ClassicSolverFactory +import it.unibo.tuprolog.solve.SolverFactory +import it.unibo.tuprolog.solve.TestAnd import kotlin.test.Test class TestClassicAnd : TestAnd, SolverFactory by ClassicSolverFactory { @@ -38,4 +33,4 @@ class TestClassicAnd : TestAnd, SolverFactory by ClassicSolverFactory { override fun testTrueVarCallable() { prototype.testTrueVarCallable() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicArg.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicArg.kt index 4e12e7da5..e79af6964 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicArg.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicArg.kt @@ -1,13 +1,8 @@ package it.unibo.tuprolog.solve.systemtest -import it.unibo.tuprolog.solve.* -import it.unibo.tuprolog.solve.channel.InputChannel -import it.unibo.tuprolog.solve.channel.OutputChannel -import it.unibo.tuprolog.solve.exception.PrologWarning -import it.unibo.tuprolog.solve.library.AliasedLibrary -import it.unibo.tuprolog.solve.library.Libraries -import it.unibo.tuprolog.solve.stdlib.DefaultBuiltins -import it.unibo.tuprolog.theory.Theory +import it.unibo.tuprolog.solve.ClassicSolverFactory +import it.unibo.tuprolog.solve.SolverFactory +import it.unibo.tuprolog.solve.TestArg import kotlin.test.Test class TestClassicArg : TestArg, SolverFactory by ClassicSolverFactory { @@ -20,67 +15,67 @@ class TestClassicArg : TestArg, SolverFactory by ClassicSolverFactory { } @Test - override fun testArgFromFooX(){ + override fun testArgFromFooX() { prototype.testArgFromFooX() } @Test - override fun testArgFromFoo2(){ + override fun testArgFromFoo2() { prototype.testArgFromFoo2() } @Test - override fun testArgFromFooInF(){ + override fun testArgFromFooInF() { prototype.testArgFromFooInF() } @Test - override fun testArgFromFooY(){ + override fun testArgFromFooY() { prototype.testArgFromFooY() } @Test - override fun testArgFromFooInSecondTerm(){ + override fun testArgFromFooInSecondTerm() { prototype.testArgFromFooInSecondTerm() } @Test - override fun testArgFromFooInFoo(){ + override fun testArgFromFooInFoo() { prototype.testArgFromFooInFoo() } @Test - override fun testArgNumberFromFoo(){ + override fun testArgNumberFromFoo() { prototype.testArgNumberFromFoo() } @Test - override fun testArgXFromFoo(){ + override fun testArgXFromFoo() { prototype.testArgXFromFoo() } @Test - override fun testArgNumberFromX(){ + override fun testArgNumberFromX() { prototype.testArgNumberFromX() } @Test - override fun testArgFromAtom(){ + override fun testArgFromAtom() { prototype.testArgFromAtom() } @Test - override fun testArgFromNumber(){ + override fun testArgFromNumber() { prototype.testArgFromNumber() } @Test - override fun testNegativeArgFromFoo(){ + override fun testNegativeArgFromFoo() { prototype.testNegativeArgFromFoo() } @Test - override fun testArgAFromFoo(){ + override fun testArgAFromFoo() { prototype.testArgAFromFoo() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicArith.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicArith.kt index 9dd55c9ac..468b2a5bb 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicArith.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicArith.kt @@ -1,13 +1,8 @@ package it.unibo.tuprolog.solve.systemtest -import it.unibo.tuprolog.solve.* -import it.unibo.tuprolog.solve.channel.InputChannel -import it.unibo.tuprolog.solve.channel.OutputChannel -import it.unibo.tuprolog.solve.exception.PrologWarning -import it.unibo.tuprolog.solve.library.AliasedLibrary -import it.unibo.tuprolog.solve.library.Libraries -import it.unibo.tuprolog.solve.stdlib.DefaultBuiltins -import it.unibo.tuprolog.theory.Theory +import it.unibo.tuprolog.solve.ClassicSolverFactory +import it.unibo.tuprolog.solve.SolverFactory +import it.unibo.tuprolog.solve.TestArith import kotlin.test.Test class TestClassicArith : TestArith, SolverFactory by ClassicSolverFactory { @@ -43,4 +38,3 @@ class TestClassicArith : TestArith, SolverFactory by ClassicSolverFactory { prototype.testArithLessThanEq() } } - diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAssertA.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAssertA.kt index 228ea4f00..925b85ca3 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAssertA.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAssertA.kt @@ -5,7 +5,7 @@ import it.unibo.tuprolog.solve.SolverFactory import it.unibo.tuprolog.solve.TestAssertA import kotlin.test.Test -class TestClassicAssertA : TestAssertA, SolverFactory by ClassicSolverFactory{ +class TestClassicAssertA : TestAssertA, SolverFactory by ClassicSolverFactory { private val prototype = TestAssertA.prototype(this) @Test @@ -32,4 +32,4 @@ class TestClassicAssertA : TestAssertA, SolverFactory by ClassicSolverFactory{ override fun testAssertAAtomTrue() { prototype.testAssertAAtomTrue() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAssertZ.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAssertZ.kt index 9ce7397be..2e5a7b8ec 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAssertZ.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAssertZ.kt @@ -5,7 +5,7 @@ import it.unibo.tuprolog.solve.SolverFactory import it.unibo.tuprolog.solve.TestAssertZ import kotlin.test.Test -class TestClassicAssertZ : TestAssertZ, SolverFactory by ClassicSolverFactory{ +class TestClassicAssertZ : TestAssertZ, SolverFactory by ClassicSolverFactory { private val prototype = TestAssertZ.prototype(this) @Test @@ -32,4 +32,4 @@ class TestClassicAssertZ : TestAssertZ, SolverFactory by ClassicSolverFactory{ override fun testAssertZAtomTrue() { prototype.testAssertZAtomTrue() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAtom.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAtom.kt index a99fb9943..8c84687f1 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAtom.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAtom.kt @@ -1,13 +1,8 @@ package it.unibo.tuprolog.solve.systemtest -import it.unibo.tuprolog.solve.* -import it.unibo.tuprolog.solve.channel.InputChannel -import it.unibo.tuprolog.solve.channel.OutputChannel -import it.unibo.tuprolog.solve.exception.PrologWarning -import it.unibo.tuprolog.solve.library.AliasedLibrary -import it.unibo.tuprolog.solve.library.Libraries -import it.unibo.tuprolog.solve.stdlib.DefaultBuiltins -import it.unibo.tuprolog.theory.Theory +import it.unibo.tuprolog.solve.ClassicSolverFactory +import it.unibo.tuprolog.solve.SolverFactory +import it.unibo.tuprolog.solve.TestAtom import kotlin.test.Test class TestClassicAtom : TestAtom, SolverFactory by ClassicSolverFactory { @@ -25,27 +20,27 @@ class TestClassicAtom : TestAtom, SolverFactory by ClassicSolverFactory { } @Test - override fun testAtomAofB(){ + override fun testAtomAofB() { prototype.testAtomAofB() } @Test - override fun testAtomVar(){ + override fun testAtomVar() { prototype.testAtomVar() } @Test - override fun testAtomEmptyList(){ + override fun testAtomEmptyList() { prototype.testAtomEmptyList() } @Test - override fun testAtomNum(){ + override fun testAtomNum() { prototype.testAtomNum() } @Test - override fun testAtomNumDec(){ + override fun testAtomNumDec() { prototype.testAtomNumDec() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAtomic.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAtomic.kt index e13b63f8a..c1f2db30f 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAtomic.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicAtomic.kt @@ -1,13 +1,8 @@ package it.unibo.tuprolog.solve.systemtest -import it.unibo.tuprolog.solve.* -import it.unibo.tuprolog.solve.channel.InputChannel -import it.unibo.tuprolog.solve.channel.OutputChannel -import it.unibo.tuprolog.solve.exception.PrologWarning -import it.unibo.tuprolog.solve.library.AliasedLibrary -import it.unibo.tuprolog.solve.library.Libraries -import it.unibo.tuprolog.solve.stdlib.DefaultBuiltins -import it.unibo.tuprolog.theory.Theory +import it.unibo.tuprolog.solve.ClassicSolverFactory +import it.unibo.tuprolog.solve.SolverFactory +import it.unibo.tuprolog.solve.TestAtomic import kotlin.test.Test class TestClassicAtomic : TestAtomic, SolverFactory by ClassicSolverFactory { @@ -25,22 +20,22 @@ class TestClassicAtomic : TestAtomic, SolverFactory by ClassicSolverFactory { } @Test - override fun testAtomicVar(){ + override fun testAtomicVar() { prototype.testAtomicVar() } @Test - override fun testAtomicEmptyList(){ + override fun testAtomicEmptyList() { prototype.testAtomicEmptyList() } @Test - override fun testAtomicNum(){ + override fun testAtomicNum() { prototype.testAtomicNum() } @Test - override fun testAtomicNumDec(){ + override fun testAtomicNumDec() { prototype.testAtomicNumDec() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicCall.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicCall.kt index 20cb40371..589845b99 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicCall.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicCall.kt @@ -3,14 +3,13 @@ package it.unibo.tuprolog.solve.systemtest import it.unibo.tuprolog.solve.ClassicSolverFactory import it.unibo.tuprolog.solve.SolverFactory import it.unibo.tuprolog.solve.TestCall -import kotlin.test.Ignore import kotlin.test.Test -class TestClassicCall : TestCall, SolverFactory by ClassicSolverFactory { +class TestClassicCall : TestCall, SolverFactory by ClassicSolverFactory { private val prototype = TestCall.prototype(this) @Test - override fun testCallCut(){ + override fun testCallCut() { prototype.testCallCut() } @@ -63,4 +62,4 @@ class TestClassicCall : TestCall, SolverFactory by ClassicSolverFactory { override fun testCallTrue() { prototype.testCallTrue() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicCatchAndThrow.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicCatchAndThrow.kt index 92222cc58..66ef2d6fa 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicCatchAndThrow.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicCatchAndThrow.kt @@ -5,7 +5,7 @@ import it.unibo.tuprolog.solve.SolverFactory import it.unibo.tuprolog.solve.TestCatchAndThrow import kotlin.test.Test -class TestClassicCatchAndThrow : TestCatchAndThrow, SolverFactory by ClassicSolverFactory { +class TestClassicCatchAndThrow : TestCatchAndThrow, SolverFactory by ClassicSolverFactory { private val prototype = TestCatchAndThrow.prototype(this) @Test @@ -17,4 +17,4 @@ class TestClassicCatchAndThrow : TestCatchAndThrow, SolverFactory by ClassicSolv override fun testCatchFail() { prototype.testCatchFail() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicClause.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicClause.kt index ce414f268..7cd89d6f9 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicClause.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicClause.kt @@ -3,10 +3,9 @@ package it.unibo.tuprolog.solve.systemtest import it.unibo.tuprolog.solve.ClassicSolverFactory import it.unibo.tuprolog.solve.SolverFactory import it.unibo.tuprolog.solve.TestClause -import kotlin.test.Ignore import kotlin.test.Test -class TestClassicClause : TestClause, SolverFactory by ClassicSolverFactory { +class TestClassicClause : TestClause, SolverFactory by ClassicSolverFactory { private val prototype = TestClause.prototype(this) @Test @@ -33,4 +32,4 @@ class TestClassicClause : TestClause, SolverFactory by ClassicSolverFactory { override fun testClauseAtomBody() { prototype.testClauseAtomBody() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicCompound.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicCompound.kt index b9f26b376..a8a87a26d 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicCompound.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicCompound.kt @@ -5,7 +5,7 @@ import it.unibo.tuprolog.solve.SolverFactory import it.unibo.tuprolog.solve.TestCompound import kotlin.test.Test -class TestClassicCompound : TestCompound, SolverFactory by ClassicSolverFactory { +class TestClassicCompound : TestCompound, SolverFactory by ClassicSolverFactory { private val prototype = TestCompound.prototype(this) @Test @@ -42,4 +42,4 @@ class TestClassicCompound : TestCompound, SolverFactory by ClassicSolverFactory override fun testCompoundListA() { prototype.testCompoundListA() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicCopyTerm.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicCopyTerm.kt index a1107af43..e29bfaadd 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicCopyTerm.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicCopyTerm.kt @@ -3,10 +3,9 @@ package it.unibo.tuprolog.solve.systemtest import it.unibo.tuprolog.solve.ClassicSolverFactory import it.unibo.tuprolog.solve.SolverFactory import it.unibo.tuprolog.solve.TestCopyTerm -import kotlin.test.Ignore import kotlin.test.Test -class TestClassicCopyTerm : TestCopyTerm, SolverFactory by ClassicSolverFactory { +class TestClassicCopyTerm : TestCopyTerm, SolverFactory by ClassicSolverFactory { private val prototype = TestCopyTerm.prototype(this) @Test @@ -53,4 +52,4 @@ class TestClassicCopyTerm : TestCopyTerm, SolverFactory by ClassicSolverFactory override fun testDoubleCopy() { prototype.testDoubleCopy() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicCut.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicCut.kt index 0792ab157..8c9997fb8 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicCut.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicCut.kt @@ -5,7 +5,7 @@ import it.unibo.tuprolog.solve.SolverFactory import it.unibo.tuprolog.solve.TestCut import kotlin.test.Test -class TestClassicCut: TestCut, SolverFactory by ClassicSolverFactory { +class TestClassicCut : TestCut, SolverFactory by ClassicSolverFactory { private val prototype = TestCut.prototype(this) @@ -23,4 +23,4 @@ class TestClassicCut: TestCut, SolverFactory by ClassicSolverFactory { override fun testCallCutFailTrue() { prototype.testCallCutFailTrue() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicFail.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicFail.kt index 3cd57965d..127ca2364 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicFail.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicFail.kt @@ -3,10 +3,9 @@ package it.unibo.tuprolog.solve.systemtest import it.unibo.tuprolog.solve.ClassicSolverFactory import it.unibo.tuprolog.solve.SolverFactory import it.unibo.tuprolog.solve.TestFail -import kotlin.test.Ignore import kotlin.test.Test -class TestClassicFail : TestFail, SolverFactory by ClassicSolverFactory { +class TestClassicFail : TestFail, SolverFactory by ClassicSolverFactory { private val prototype = TestFail.prototype(this) @Test @@ -28,4 +27,4 @@ class TestClassicFail : TestFail, SolverFactory by ClassicSolverFactory { override fun testSetFlagWarning() { prototype.testSetFlagWarning() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicFindAll.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicFindAll.kt index a6669dc8a..af91a7352 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicFindAll.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicFindAll.kt @@ -1,13 +1,8 @@ package it.unibo.tuprolog.solve.systemtest -import it.unibo.tuprolog.solve.* -import it.unibo.tuprolog.solve.channel.InputChannel -import it.unibo.tuprolog.solve.channel.OutputChannel -import it.unibo.tuprolog.solve.exception.PrologWarning -import it.unibo.tuprolog.solve.library.AliasedLibrary -import it.unibo.tuprolog.solve.library.Libraries -import it.unibo.tuprolog.solve.stdlib.DefaultBuiltins -import it.unibo.tuprolog.theory.Theory +import it.unibo.tuprolog.solve.ClassicSolverFactory +import it.unibo.tuprolog.solve.SolverFactory +import it.unibo.tuprolog.solve.TestFindAll import kotlin.test.Test class TestClassicFindAll : TestFindAll, SolverFactory by ClassicSolverFactory { @@ -25,37 +20,37 @@ class TestClassicFindAll : TestFindAll, SolverFactory by ClassicSolverFactory { } @Test - override fun testFindXinFail(){ + override fun testFindXinFail() { prototype.testFindXinFail() } @Test - override fun testFindXinSameXValues(){ + override fun testFindXinSameXValues() { prototype.testFindXinSameXValues() } @Test - override fun testResultListIsCorrect(){ + override fun testResultListIsCorrect() { prototype.testResultListIsCorrect() } @Test - override fun testFindXtoDoubleAssigment(){ + override fun testFindXtoDoubleAssigment() { prototype.testFindXtoDoubleAssigment() } @Test - override fun testFindXinGoal(){ + override fun testFindXinGoal() { prototype.testFindXinGoal() } @Test - override fun testFindXinNumber(){ + override fun testFindXinNumber() { prototype.testFindXinNumber() } @Test - override fun testFindXinCall(){ + override fun testFindXinCall() { prototype.testFindXinCall() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicFloat.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicFloat.kt index 4a59e6d67..9304b1194 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicFloat.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicFloat.kt @@ -5,7 +5,7 @@ import it.unibo.tuprolog.solve.SolverFactory import it.unibo.tuprolog.solve.TestFloat import kotlin.test.Test -class TestClassicFloat : TestFloat, SolverFactory by ClassicSolverFactory { +class TestClassicFloat : TestFloat, SolverFactory by ClassicSolverFactory { private val prototype = TestFloat.prototype(this) @Test @@ -32,4 +32,4 @@ class TestClassicFloat : TestFloat, SolverFactory by ClassicSolverFactory { override fun testFloatX() { prototype.testFloatX() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicFunctor.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicFunctor.kt index 767ea995b..273ce0468 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicFunctor.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicFunctor.kt @@ -3,14 +3,13 @@ package it.unibo.tuprolog.solve.systemtest import it.unibo.tuprolog.solve.ClassicSolverFactory import it.unibo.tuprolog.solve.SolverFactory import it.unibo.tuprolog.solve.TestFunctor -import kotlin.test.Ignore import kotlin.test.Test -class TestClassicFunctor : TestFunctor, SolverFactory by ClassicSolverFactory { +class TestClassicFunctor : TestFunctor, SolverFactory by ClassicSolverFactory { private val prototype = TestFunctor.prototype(this) @Test - override fun testFunArity(){ + override fun testFunArity() { prototype.testFunArity() } @@ -93,4 +92,4 @@ class TestClassicFunctor : TestFunctor, SolverFactory by ClassicSolverFactory { override fun testFunNegativeArity() { prototype.testFunNegativeArity() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicIfThen.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicIfThen.kt index 114995e03..cfb0ba5db 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicIfThen.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicIfThen.kt @@ -5,7 +5,7 @@ import it.unibo.tuprolog.solve.SolverFactory import it.unibo.tuprolog.solve.TestIfThen import kotlin.test.Test -class TestClassicIfThen : TestIfThen, SolverFactory by ClassicSolverFactory { +class TestClassicIfThen : TestIfThen, SolverFactory by ClassicSolverFactory { private val prototype = TestIfThen.prototype(this) @Test @@ -37,4 +37,4 @@ class TestClassicIfThen : TestIfThen, SolverFactory by ClassicSolverFactory { override fun testIfThenXtoOne() { prototype.testIfThenXtoOne() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicIfThenElse.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicIfThenElse.kt index c4ef3e875..05a20e3c3 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicIfThenElse.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicIfThenElse.kt @@ -5,7 +5,7 @@ import it.unibo.tuprolog.solve.SolverFactory import it.unibo.tuprolog.solve.TestIfThenElse import kotlin.test.Test -class TestClassicIfThenElse : TestIfThenElse, SolverFactory by ClassicSolverFactory { +class TestClassicIfThenElse : TestIfThenElse, SolverFactory by ClassicSolverFactory { private val prototype = TestIfThenElse.prototype(this) @Test @@ -47,4 +47,4 @@ class TestClassicIfThenElse : TestIfThenElse, SolverFactory by ClassicSolverFact override fun testIfOrElseTrue() { prototype.testIfOrElseTrue() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicInteger.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicInteger.kt index 7e3fbb375..c9c59d36e 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicInteger.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicInteger.kt @@ -1,13 +1,8 @@ package it.unibo.tuprolog.solve.systemtest -import it.unibo.tuprolog.solve.* -import it.unibo.tuprolog.solve.channel.InputChannel -import it.unibo.tuprolog.solve.channel.OutputChannel -import it.unibo.tuprolog.solve.exception.PrologWarning -import it.unibo.tuprolog.solve.library.AliasedLibrary -import it.unibo.tuprolog.solve.library.Libraries -import it.unibo.tuprolog.solve.stdlib.DefaultBuiltins -import it.unibo.tuprolog.theory.Theory +import it.unibo.tuprolog.solve.ClassicSolverFactory +import it.unibo.tuprolog.solve.SolverFactory +import it.unibo.tuprolog.solve.TestInteger import kotlin.test.Test class TestClassicInteger : TestInteger, SolverFactory by ClassicSolverFactory { @@ -38,4 +33,4 @@ class TestClassicInteger : TestInteger, SolverFactory by ClassicSolverFactory { override fun testIntAtom() { prototype.testIntAtom() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicIs.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicIs.kt index 43772d62d..b28206b3a 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicIs.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicIs.kt @@ -5,7 +5,7 @@ import it.unibo.tuprolog.solve.SolverFactory import it.unibo.tuprolog.solve.TestIs import kotlin.test.Test -class TestClassicIs : TestIs, SolverFactory by ClassicSolverFactory { +class TestClassicIs : TestIs, SolverFactory by ClassicSolverFactory { private val prototype = TestIs.prototype(this) @Test @@ -14,7 +14,7 @@ class TestClassicIs : TestIs, SolverFactory by ClassicSolverFactory { } @Test - override fun testIsXY(){ + override fun testIsXY() { prototype.testIsXY() } @@ -37,4 +37,4 @@ class TestClassicIs : TestIs, SolverFactory by ClassicSolverFactory { override fun testIsXFloat() { prototype.testIsXFloat() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicNonVar.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicNonVar.kt index 0a77ecb55..682171be1 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicNonVar.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicNonVar.kt @@ -1,13 +1,8 @@ package it.unibo.tuprolog.solve.systemtest -import it.unibo.tuprolog.solve.* -import it.unibo.tuprolog.solve.channel.InputChannel -import it.unibo.tuprolog.solve.channel.OutputChannel -import it.unibo.tuprolog.solve.exception.PrologWarning -import it.unibo.tuprolog.solve.library.AliasedLibrary -import it.unibo.tuprolog.solve.library.Libraries -import it.unibo.tuprolog.solve.stdlib.DefaultBuiltins -import it.unibo.tuprolog.theory.Theory +import it.unibo.tuprolog.solve.ClassicSolverFactory +import it.unibo.tuprolog.solve.SolverFactory +import it.unibo.tuprolog.solve.TestNonVar import kotlin.test.Test class TestClassicNonVar : TestNonVar, SolverFactory by ClassicSolverFactory { @@ -43,4 +38,4 @@ class TestClassicNonVar : TestNonVar, SolverFactory by ClassicSolverFactory { override fun testNonVar() { prototype.testNonVar() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicNotProvable.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicNotProvable.kt index 29bef91e8..5bdc9ae5e 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicNotProvable.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicNotProvable.kt @@ -3,10 +3,9 @@ package it.unibo.tuprolog.solve.systemtest import it.unibo.tuprolog.solve.ClassicSolverFactory import it.unibo.tuprolog.solve.SolverFactory import it.unibo.tuprolog.solve.TestNotProvable -import kotlin.test.Ignore import kotlin.test.Test -class TestClassicNotProvable : TestNotProvable, SolverFactory by ClassicSolverFactory { +class TestClassicNotProvable : TestNotProvable, SolverFactory by ClassicSolverFactory { private val prototype = TestNotProvable.prototype(this) @Test @@ -43,4 +42,4 @@ class TestClassicNotProvable : TestNotProvable, SolverFactory by ClassicSolverFa override fun testOrNotCutFail() { prototype.testOrNotCutFail() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicNotUnify.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicNotUnify.kt index 714ede7d5..f5e49bdc2 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicNotUnify.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicNotUnify.kt @@ -1,13 +1,8 @@ package it.unibo.tuprolog.solve.systemtest -import it.unibo.tuprolog.solve.* -import it.unibo.tuprolog.solve.channel.InputChannel -import it.unibo.tuprolog.solve.channel.OutputChannel -import it.unibo.tuprolog.solve.exception.PrologWarning -import it.unibo.tuprolog.solve.library.AliasedLibrary -import it.unibo.tuprolog.solve.library.Libraries -import it.unibo.tuprolog.solve.stdlib.DefaultBuiltins -import it.unibo.tuprolog.theory.Theory +import it.unibo.tuprolog.solve.ClassicSolverFactory +import it.unibo.tuprolog.solve.SolverFactory +import it.unibo.tuprolog.solve.TestNotUnify import kotlin.test.Test class TestClassicNotUnify : TestNotUnify, SolverFactory by ClassicSolverFactory { @@ -63,5 +58,4 @@ class TestClassicNotUnify : TestNotUnify, SolverFactory by ClassicSolverFactory override fun testFMultipleTermNotUnify() { prototype.testFMultipleTermNotUnify() } - -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicNumber.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicNumber.kt index 97fedfc12..8bc76e808 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicNumber.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicNumber.kt @@ -33,5 +33,4 @@ class TestClassicNumber : TestNumber, SolverFactory by ClassicSolverFactory { override fun testXNum() { prototype.testXNum() } - -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicOnce.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicOnce.kt index a16655450..2ec2fc07c 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicOnce.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicOnce.kt @@ -3,10 +3,9 @@ package it.unibo.tuprolog.solve.systemtest import it.unibo.tuprolog.solve.ClassicSolverFactory import it.unibo.tuprolog.solve.SolverFactory import it.unibo.tuprolog.solve.TestOnce -import kotlin.test.Ignore import kotlin.test.Test -class TestClassicOnce : TestOnce, SolverFactory by ClassicSolverFactory { +class TestClassicOnce : TestOnce, SolverFactory by ClassicSolverFactory { private val prototype = TestOnce.prototype(this) @Test @@ -38,4 +37,4 @@ class TestClassicOnce : TestOnce, SolverFactory by ClassicSolverFactory { override fun testOnceX() { prototype.testOnceX() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicOr.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicOr.kt index 5fd4a0127..fa3bd4bc1 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicOr.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicOr.kt @@ -1,13 +1,8 @@ package it.unibo.tuprolog.solve.systemtest -import it.unibo.tuprolog.solve.* -import it.unibo.tuprolog.solve.channel.InputChannel -import it.unibo.tuprolog.solve.channel.OutputChannel -import it.unibo.tuprolog.solve.exception.PrologWarning -import it.unibo.tuprolog.solve.library.AliasedLibrary -import it.unibo.tuprolog.solve.library.Libraries -import it.unibo.tuprolog.solve.stdlib.DefaultBuiltins -import it.unibo.tuprolog.theory.Theory +import it.unibo.tuprolog.solve.ClassicSolverFactory +import it.unibo.tuprolog.solve.SolverFactory +import it.unibo.tuprolog.solve.TestOr import kotlin.test.Test class TestClassicOr : TestOr, SolverFactory by ClassicSolverFactory { @@ -38,6 +33,4 @@ class TestClassicOr : TestOr, SolverFactory by ClassicSolverFactory { override fun testOrDoubleAssignment() { prototype.testOrDoubleAssignment() } - - -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicRepeat.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicRepeat.kt index f564f2777..097b6a7c8 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicRepeat.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicRepeat.kt @@ -5,11 +5,11 @@ import it.unibo.tuprolog.solve.SolverFactory import it.unibo.tuprolog.solve.TestRepeat import kotlin.test.Test -class TestClassicRepeat : TestRepeat, SolverFactory by ClassicSolverFactory { +class TestClassicRepeat : TestRepeat, SolverFactory by ClassicSolverFactory { private val prototype = TestRepeat.prototype(this) @Test override fun testRepeat() { prototype.testRepeat() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicRetract.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicRetract.kt index b0fee4d6c..c2e0f4147 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicRetract.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicRetract.kt @@ -3,10 +3,9 @@ package it.unibo.tuprolog.solve.systemtest import it.unibo.tuprolog.solve.ClassicSolverFactory import it.unibo.tuprolog.solve.SolverFactory import it.unibo.tuprolog.solve.TestRetract -import kotlin.test.Ignore import kotlin.test.Test -class TestClassicRetract : TestRetract, SolverFactory by ClassicSolverFactory { +class TestClassicRetract : TestRetract, SolverFactory by ClassicSolverFactory { private val prototype = TestRetract.prototype(this) @Test @@ -18,4 +17,4 @@ class TestClassicRetract : TestRetract, SolverFactory by ClassicSolverFactory { override fun testRetractAtomEmptyList() { prototype.testRetractAtomEmptyList() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicSolver.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicSolver.kt index 1f2de5f6a..3b4db666f 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicSolver.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicSolver.kt @@ -1,6 +1,8 @@ package it.unibo.tuprolog.solve.systemtest -import it.unibo.tuprolog.solve.* +import it.unibo.tuprolog.solve.ClassicSolverFactory +import it.unibo.tuprolog.solve.SolverFactory +import it.unibo.tuprolog.solve.TestSolver import kotlin.test.Ignore import kotlin.test.Test @@ -78,7 +80,6 @@ class TestClassicSolver : TestSolver, SolverFactory by ClassicSolverFactory { prototype.testIfThenElse2() } - @Test override fun testTimeout1() { prototype.testTimeout1() diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicTerm.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicTerm.kt index a250fa4ab..4d97d08f6 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicTerm.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicTerm.kt @@ -2,7 +2,6 @@ package it.unibo.tuprolog.solve.systemtest import it.unibo.tuprolog.solve.ClassicSolverFactory import it.unibo.tuprolog.solve.SolverFactory -import it.unibo.tuprolog.solve.TestInteger import it.unibo.tuprolog.solve.TestTerm import kotlin.test.Test @@ -39,4 +38,4 @@ class TestClassicTerm : TestTerm, SolverFactory by ClassicSolverFactory { override fun testTermLessThanEq() { prototype.testTermLessThanEq() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicTrue.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicTrue.kt index bb0d8e086..18a5a4b3f 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicTrue.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicTrue.kt @@ -5,11 +5,11 @@ import it.unibo.tuprolog.solve.SolverFactory import it.unibo.tuprolog.solve.TestTrue import kotlin.test.Test -class TestClassicTrue : TestTrue, SolverFactory by ClassicSolverFactory { +class TestClassicTrue : TestTrue, SolverFactory by ClassicSolverFactory { private val prototype = TestTrue.prototype(this) @Test override fun testTrue() { prototype.testTrue() } -} \ No newline at end of file +} diff --git a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicUnify.kt b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicUnify.kt index f36cc3171..06b76f7b9 100644 --- a/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicUnify.kt +++ b/solve-classic/src/commonTest/kotlin/it/unibo/tuprolog/solve/systemtest/TestClassicUnify.kt @@ -1,13 +1,8 @@ package it.unibo.tuprolog.solve.systemtest -import it.unibo.tuprolog.solve.* -import it.unibo.tuprolog.solve.channel.InputChannel -import it.unibo.tuprolog.solve.channel.OutputChannel -import it.unibo.tuprolog.solve.exception.PrologWarning -import it.unibo.tuprolog.solve.library.AliasedLibrary -import it.unibo.tuprolog.solve.library.Libraries -import it.unibo.tuprolog.solve.stdlib.DefaultBuiltins -import it.unibo.tuprolog.theory.Theory +import it.unibo.tuprolog.solve.ClassicSolverFactory +import it.unibo.tuprolog.solve.SolverFactory +import it.unibo.tuprolog.solve.TestUnify import kotlin.test.Test class TestClassicUnify : TestUnify, SolverFactory by ClassicSolverFactory { @@ -68,5 +63,4 @@ class TestClassicUnify : TestUnify, SolverFactory by ClassicSolverFactory { override fun testMultipleTermUnify() { prototype.testMultipleTermUnify() } - -} \ No newline at end of file +}