Compare commits

..

No commits in common. "973365e2ec75f3915bc2bb9ae14fd98801552b0b" and "8bda3c5af464f46de4871cf773feeee313faf212" have entirely different histories.

3 changed files with 2 additions and 30 deletions

View file

@ -63,8 +63,6 @@ open class Preprocessor {
Functor.of("functor/3") -> FunctorOp(args[0], args[1], args[2]) Functor.of("functor/3") -> FunctorOp(args[0], args[1], args[2])
Functor.of("arg/3") -> Arg(args[0], args[1], args[2]) Functor.of("arg/3") -> Arg(args[0], args[1], args[2])
Functor.of("clause/2") -> ClauseOp(args[0] as Head, args[1] as Body) Functor.of("clause/2") -> ClauseOp(args[0] as Head, args[1] as Body)
Functor.of("atomic/1") -> AtomicOp(args[0])
Functor.of("compound/1") -> CompoundOp(args[0])
// Arithmetic // Arithmetic
Functor.of("inf/0") -> Integer(Int.MAX_VALUE) Functor.of("inf/0") -> Integer(Int.MAX_VALUE)
@ -113,6 +111,7 @@ open class Preprocessor {
Functor.of("!/0") -> Cut() Functor.of("!/0") -> Cut()
Functor.of(",/2") -> Conjunction(args[0] as LogicOperand, args[1] as LogicOperand) Functor.of(",/2") -> Conjunction(args[0] as LogicOperand, args[1] as LogicOperand)
Functor.of(";/2") -> Disjunction(args[0] as LogicOperand, args[1] as LogicOperand) Functor.of(";/2") -> Disjunction(args[0] as LogicOperand, args[1] as LogicOperand)
Functor.of("|/2") -> Bar(args[0] as LogicOperand, args[1] as LogicOperand)
Functor.of("\\+/1") -> Not(args[0] as Goal) Functor.of("\\+/1") -> Not(args[0] as Goal)
// Database // Database

View file

@ -137,23 +137,3 @@ class ClauseOp(private val head: Head, private val body: Body) :
} }
} }
} }
class AtomicOp(private val term: Term) : Operator(Atom("atomic"), null, term) {
override fun satisfy(subs: Substitutions): Answers {
return if (atomic(term, subs)) {
sequenceOf(Result.success(emptyMap()))
} else {
emptySequence()
}
}
}
class CompoundOp(private val term: Term) : Operator(Atom("compound"), null, term) {
override fun satisfy(subs: Substitutions): Answers {
return if (compound(term, subs)) {
sequenceOf(Result.success(emptyMap()))
} else {
emptySequence()
}
}
}

View file

@ -55,14 +55,7 @@ class Repl {
} }
} }
"" -> { "a" -> return
io.checkNewLine()
return
}
"a" -> {
io.checkNewLine()
return
}
"." -> { "." -> {
io.checkNewLine() io.checkNewLine()
return return