Checkpoint

This commit is contained in:
Tibo De Peuter 2025-04-06 12:14:18 +02:00
parent 438af6c053
commit 6eca9dfcb7
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
25 changed files with 309 additions and 113 deletions

View file

@ -1,16 +1,17 @@
package prolog.components.terms
import prolog.components.Program
import prolog.components.Provable
/**
* Question stated to the Prolog engine.
* Ask the Prolog engine.
*
* A goal is either an [atom][prolog.components.terms.Atom] or a [compound term][prolog.components.terms.CompoundTerm].
* 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 : Head() {
fun prove(): Boolean {
return Program.query(this)
}
abstract class Goal : Term, Provable {
abstract val functor: Functor
override fun prove(): Boolean = Program.query(this)
}