Scala2P

scalata.domain.util.Scala2P
object Scala2P

Thin helper around tuProlog that:

  • adds Scala → Prolog implicit conversions (String, Seq);

  • provides extractors (asInt, asPoint);

  • builds a reusable Prolog engine with arbitrary clauses.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Scala2P.type

Members list

Value members

Concrete methods

def asInt(t: Term): Int

Down-cast a Prolog numeric term to Scala Int.

Down-cast a Prolog numeric term to Scala Int.

Attributes

def asPoint(t: Term): Point2D

Extract a pos(X,Y) struct to a Scala Point2D.

Extract a pos(X,Y) struct to a Scala Point2D.

Attributes

def mkPrologEngine(clauses: String*): Term => LazyList[SolveInfo]

Build a Prolog engine seeded with clauses. Returns a function that, given a goal term, yields a lazy stream of SolveInfo solutions.

Build a Prolog engine seeded with clauses. Returns a function that, given a goal term, yields a lazy stream of SolveInfo solutions.

Attributes

Givens

Givens

given given_Conversion_Seq_Term: Conversion[Seq[_], Term]
given given_Conversion_String_Term: Conversion[String, Term]