fix: Mib
This commit is contained in:
parent
7daae860fc
commit
1feb3893c5
4 changed files with 45 additions and 27 deletions
|
@ -2,14 +2,15 @@ package prolog.builtins
|
|||
|
||||
import prolog.Answers
|
||||
import prolog.Substitutions
|
||||
import prolog.ast.Database.Program
|
||||
import prolog.ast.logic.LogicOperand
|
||||
import prolog.ast.logic.LogicOperator
|
||||
import prolog.ast.terms.Atom
|
||||
import prolog.ast.terms.Body
|
||||
import prolog.ast.terms.Goal
|
||||
import prolog.ast.terms.Structure
|
||||
import prolog.flags.AppliedCut
|
||||
import prolog.logic.applySubstitution
|
||||
import prolog.logic.numbervars
|
||||
|
||||
/**
|
||||
* Always fail.
|
||||
|
@ -53,8 +54,8 @@ class Conjunction(val left: LogicOperand, private val right: LogicOperand) :
|
|||
left.fold(
|
||||
// If it succeeds, satisfy the right part with the updated substitutions and return all results
|
||||
onSuccess = { leftSubs ->
|
||||
right.satisfy(subs + leftSubs).forEach {
|
||||
it.fold(
|
||||
right.satisfy(subs + leftSubs).forEach { right ->
|
||||
right.fold(
|
||||
// If the right part succeeds, yield the result with the left substitutions
|
||||
onSuccess = { rightSubs ->
|
||||
yield(Result.success(leftSubs + rightSubs))
|
||||
|
|
Reference in a new issue