refactor: Herstructurering
This commit is contained in:
parent
1acd1cfb67
commit
e3c84e1761
33 changed files with 290 additions and 178 deletions
18
src/prolog/ast/terms/Goal.kt
Normal file
18
src/prolog/ast/terms/Goal.kt
Normal file
|
@ -0,0 +1,18 @@
|
|||
package prolog.ast.terms
|
||||
|
||||
import prolog.Program
|
||||
import prolog.ast.logic.Provable
|
||||
import prolog.logic.Substituted
|
||||
|
||||
/**
|
||||
* Ask the Prolog engine.
|
||||
*
|
||||
* A goal is either an [Atom] or a [CompoundTerm].
|
||||
* A goal either [succeeds][prolog.builtins.True], in which case the variables in the compound terms have a binding,
|
||||
* or it fails if Prolog fails to prove it.
|
||||
*/
|
||||
abstract class Goal : Term, Provable {
|
||||
abstract val functor: Functor
|
||||
|
||||
override fun prove(subs: Substituted): Sequence<Substituted> = Program.solve(this, subs)
|
||||
}
|
Reference in a new issue