prolog: operator-table parser + < > =< >= built-ins, 19 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled

This commit is contained in:
2026-04-25 06:57:48 +00:00
parent e018ba9423
commit 3190e770fb
7 changed files with 342 additions and 84 deletions

View File

@@ -315,6 +315,26 @@
(list "num" (pl-eval-arith (nth (pl-args g) 1)))
trail
k))
((and (pl-compound? g) (= (pl-fun g) "<") (= (len (pl-args g)) 2))
(cond
((< (pl-eval-arith (first (pl-args g))) (pl-eval-arith (nth (pl-args g) 1)))
(k))
(true false)))
((and (pl-compound? g) (= (pl-fun g) ">") (= (len (pl-args g)) 2))
(cond
((> (pl-eval-arith (first (pl-args g))) (pl-eval-arith (nth (pl-args g) 1)))
(k))
(true false)))
((and (pl-compound? g) (= (pl-fun g) "=<") (= (len (pl-args g)) 2))
(cond
((<= (pl-eval-arith (first (pl-args g))) (pl-eval-arith (nth (pl-args g) 1)))
(k))
(true false)))
((and (pl-compound? g) (= (pl-fun g) ">=") (= (len (pl-args g)) 2))
(cond
((>= (pl-eval-arith (first (pl-args g))) (pl-eval-arith (nth (pl-args g) 1)))
(k))
(true false)))
((and (pl-compound? g) (= (pl-fun g) ",") (= (len (pl-args g)) 2))
(pl-solve!
db