Single clause queries
This commit is contained in:
parent
da21d890fb
commit
438af6c053
10 changed files with 16 additions and 32 deletions
16
src/prolog/components/terms/Goal.kt
Normal file
16
src/prolog/components/terms/Goal.kt
Normal file
|
@ -0,0 +1,16 @@
|
|||
package prolog.components.terms
|
||||
|
||||
import prolog.components.Program
|
||||
|
||||
/**
|
||||
* Question stated to the Prolog engine.
|
||||
*
|
||||
* A goal is either an [atom][prolog.components.terms.Atom] or a [compound term][prolog.components.terms.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)
|
||||
}
|
||||
}
|
Reference in a new issue