]> Repositorios git - scryer-prolog.git/commitdiff
assert rational(3) as true in tests/builtins.pl
authorMark Thom <[email protected]>
Sun, 7 Dec 2025 23:15:18 +0000 (15:15 -0800)
committerMark Thom <[email protected]>
Thu, 15 Jan 2026 04:34:06 +0000 (20:34 -0800)
src/codegen.rs
src/tests/builtins.pl

index c5a0c857a559c3c935152126196f4f68cb8abe27..67ba2dbfd9145200ef1c189151bc92b1b773de6f 100644 (file)
@@ -639,7 +639,10 @@ impl CodeGenerator {
                 }
             },
             InlinedClauseType::IsRational(..) => match terms[0] {
-                Term::Literal(_, Literal::Rational(_)) => {
+                Term::Literal(
+                    _,
+                    Literal::Rational(_) | Literal::Fixnum(_) | Literal::Integer(_),
+                ) => {
                     instr!("$succeed")
                 }
                 Term::Var(ref vr, ref name) => {
@@ -679,10 +682,13 @@ impl CodeGenerator {
                 }
             },
             InlinedClauseType::IsNumber(..) => match terms[0] {
-                Term::Literal(_, Literal::F64(..))
-                | Term::Literal(_, Literal::Rational(_))
-                | Term::Literal(_, Literal::Integer(_))
-                | Term::Literal(_, Literal::Fixnum(_)) => {
+                Term::Literal(
+                    _,
+                    Literal::F64(..)
+                    | Literal::Rational(_)
+                    | Literal::Integer(_)
+                    | Literal::Fixnum(_),
+                ) => {
                     instr!("$succeed")
                 }
                 Term::Var(ref vr, ref name) => {
index a87fc22a99ed7f661ee1ab2e12edf4f23a944ddf..1a437413696dd21f6c1c7b0b570ddabf2dbd5848 100644 (file)
@@ -46,7 +46,7 @@ test_queries_on_builtins :-
     \+ float([1,2,_]),
     \+ (X is 3 rdiv 4, float(X)),
     \+ \+ (X is 3 rdiv 4, rational(X)),
-    \+ rational(3),
+    rational(3),
     \+ rational(f(_)),
     \+ rational("sdfa"),
     \+ rational(atom),