Skip to content

Commit

Permalink
Functor/3 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Gilbocc committed Jun 16, 2020
1 parent 53d98ff commit e52f64b
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ object Functor : TernaryRelation.Functional<ExecutionContext>("functor") {
Substitution.failed()
}
is Var -> {
Substitution.of(third to Integer.of(first.arity))
if (first.functor == second.value)
Substitution.of(third to Integer.of(first.arity))
else
Substitution.failed()
}
else -> {
// TODO expected here should be INTEGER | VARIABLE
Expand All @@ -41,7 +44,10 @@ object Functor : TernaryRelation.Functional<ExecutionContext>("functor") {
is Var -> {
when (third) {
is Numeric -> {
Substitution.of(second to Atom.of(first.functor))
if (first.arity == third.intValue.toInt())
Substitution.of(second to Atom.of(first.functor))
else
Substitution.failed()
}
is Var -> {
Substitution.of(
Expand Down

0 comments on commit e52f64b

Please sign in to comment.