prolog: operator-table parser + < > =< >= built-ins, 19 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user