Coverage Summary for Class: EndState (it.unibo.tuprolog.argumentation.core.engine.fsm)

Class Class, % Method, % Branch, % Line, % Instruction, %
EndState 100% (1/1) 100% (3/3) 100% (2/2) 100% (3/3) 100% (10/10)


 // Forked from 2p-kt's solve-prolog 3.0.2 (Apache License 2.0): see README.md in this package
 package it.unibo.tuprolog.argumentation.core.engine.fsm
 
 import it.unibo.tuprolog.solve.Solution
 import kotlin.js.JsName
 
 /**
  * A [State] that carries an emitted [Solution] (`StateEnd`, reached on a positive or negative solution, or
  * `StateHalt`, reached on an uncaught exception). Every time [it.unibo.tuprolog.argumentation.core.engine.SolutionIterator]
  * visits one of these, [solution] is what it hands back to the caller.
  */
 interface EndState : State {
     /** The solution emitted by reaching this state. */
     @JsName("solution")
     val solution: Solution
 
     /** Whether asking for another solution after this one would resume resolution (via backtracking) rather than truly stop. */
     @JsName("hasOpenAlternatives")
     val hasOpenAlternatives: Boolean
         get() = solution.isYes && context.hasOpenAlternatives
 
     override val isEndState: Boolean
         get() = true
 
     override fun asEndState(): EndState = this
 }