refactor: Rework
This commit is contained in:
parent
ac55ed4c64
commit
6469dd6ced
34 changed files with 593 additions and 552 deletions
|
@ -1,6 +1,7 @@
|
|||
package prolog.ast.logic
|
||||
|
||||
import prolog.logic.Substituted
|
||||
import prolog.Answers
|
||||
import prolog.Substitutions
|
||||
import prolog.ast.terms.Functor
|
||||
import prolog.ast.terms.Goal
|
||||
|
||||
|
@ -48,7 +49,7 @@ class Predicate : Resolvent {
|
|||
this.clauses.addAll(clauses)
|
||||
}
|
||||
|
||||
override fun solve(goal: Goal, subs: Substituted): Sequence<Substituted> = sequence {
|
||||
override fun solve(goal: Goal, subs: Substitutions): Answers = sequence {
|
||||
require(goal.functor == functor) { "Goal functor does not match predicate functor" }
|
||||
// Try to unify the goal with the clause
|
||||
// If the unification is successful, yield the substitutions
|
||||
|
|
Reference in a new issue