This repository has been archived on 2025-09-23. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
2025LogProg-project-GhentPr.../src/prolog/ast/terms/Goal.kt
2025-05-04 21:50:58 +02:00

19 lines
No EOL
562 B
Kotlin

package prolog.ast.terms
import prolog.Answers
import prolog.ast.Database.Program
import prolog.Substitutions
import prolog.ast.logic.LogicOperand
/**
* 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 : LogicOperand(), Term {
abstract val functor: Functor
override fun satisfy(subs: Substitutions): Answers = Program.solve(this, subs)
}