File tree Expand file tree Collapse file tree 2 files changed +1
-17
lines changed
src/main/scala/io/github/kelvindev15/prolog/core Expand file tree Collapse file tree 2 files changed +1
-17
lines changed Original file line number Diff line number Diff line change @@ -20,13 +20,7 @@ object Struct:
20
20
private def isFunctorWellFormed (functor : String ): Boolean = functor.matches(Syntax .AtomRegex .regex)
21
21
def quoteIfFunctorIsMalformed (functor : String ): String =
22
22
if (isFunctorWellFormed(functor)) functor else s " ' $functor' "
23
- def apply (functor : Atom , args : Term * ): Struct = StructImpl (functor, args* )
24
-
25
- object Functor :
26
- def unapply (struct : Struct ): Option [Atom ] = Option (struct.functor)
27
-
28
- object Args :
29
- def unapply (struct : Struct ): Option [Iterable [Term ]] = Option (struct.arguments)
23
+ def apply (functor : Atom , args : Term * ): Struct = StructImpl (functor, args* )
30
24
31
25
private case class StructImpl (functor : Atom , arguments : Term * ) extends Struct :
32
26
override val arity : Int = arguments.size
Original file line number Diff line number Diff line change @@ -18,13 +18,3 @@ object Theory:
18
18
override def contains (clause : Clause ): Boolean = contains(clause)
19
19
override def length : Int = clauses.length
20
20
override def iterator : Iterator [Clause ] = clauses.iterator
21
-
22
- class MutableTheory (var theory : Theory = Theory ()) extends Theory :
23
- override def add (clause : Clause ): Theory = { theory = theory.add(clause) ; theory }
24
- override def remove (clause : Clause ): Theory = { theory = theory.remove(clause) ; theory }
25
- override def contains (clause : Clause ): Boolean = theory.contains(clause)
26
- override def clauses : Seq [Clause ] = theory.clauses
27
- override def length : Int = theory.length
28
- override def iterator : Iterator [Clause ] = theory.iterator
29
-
30
- override def apply (i : Int ): Clause = theory(i)
You can’t perform that action at this time.
0 commit comments