src/doc: introduce option --no-render in HTML phase.
[nit.git] / lib / ai / backtrack.nit
index 550df10..597164d 100644 (file)
@@ -40,7 +40,7 @@ module backtrack
 # # Basic search
 #
 # The method `solve` returns a new solver for a backtrack search.
-class BacktrackProblem[S: Object,A]
+abstract class BacktrackProblem[S: Object,A]
        # The starting state of the problem.
        # It is this object that will be modified by `apply_action` and `backtrack`.
        fun initial_state: S is abstract
@@ -209,6 +209,7 @@ class BacktrackSolver[S: Object, A]
 
                                problem.backtrack(state, a)
                                node = node.parent
+                               assert node != null
                                continue
                        end