Skip to content
Snippets Groups Projects
Commit 61e5a4b4 authored by Ali Sinan Köksal's avatar Ali Sinan Köksal
Browse files

basic example of a user-defined enumerator.. limited to invoking

`findAll' on it.
parent c5597f69
Branches
Tags
No related merge requests found
import cp.Definitions._
import cp.Terms._
@spec object Specs {
sealed abstract class List
case class Cons(head : Int, tail : List) extends List
case class Nil() extends List
}
object UserDefinedSolver {
import Specs._
def main(args: Array[String]): Unit = {
val myEnumerator = Iterator[List](Nil(), Cons(42, Nil()))
val userDefined = customSolver(myEnumerator)
for (l <- userDefined.findAll) {
println("Here is a solution: " + l)
}
userDefined.solve
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment