Checkpoint

This commit is contained in:
Tibo De Peuter 2025-05-01 21:16:48 +02:00
parent 9db1c66781
commit 724e911a6f
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
17 changed files with 288 additions and 95 deletions

View file

@ -66,6 +66,14 @@ open class Preprocessor {
when {
// TODO Remove hardcoding by storing the functors as constants in operators?
// Logic
term.functor == "=/2" -> {
Unify(args[0], args[1])
}
term.functor == "\\=/2" -> {
NotUnify(args[0], args[1])
}
term.functor == ",/2" -> {
Conjunction(args[0] as LogicOperand, args[1] as LogicOperand)
}
@ -92,14 +100,6 @@ open class Preprocessor {
// Arithmetic
term.functor == "=/2" && args.all { it is Expression } -> {
Unify(args[0] as Expression, args[1] as Expression)
}
term.functor == "\\=/2" && args.all { it is Expression } -> {
NotUnify(args[0] as Expression, args[1] as Expression)
}
term.functor == "-/1" && args.all { it is Expression } -> {
Negate(args[0] as Expression)
}