assert rational(3) as true in tests/builtins.pl
This commit is contained in:
@@ -639,7 +639,10 @@ impl CodeGenerator {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
InlinedClauseType::IsRational(..) => match terms[0] {
|
InlinedClauseType::IsRational(..) => match terms[0] {
|
||||||
Term::Literal(_, Literal::Rational(_)) => {
|
Term::Literal(
|
||||||
|
_,
|
||||||
|
Literal::Rational(_) | Literal::Fixnum(_) | Literal::Integer(_),
|
||||||
|
) => {
|
||||||
instr!("$succeed")
|
instr!("$succeed")
|
||||||
}
|
}
|
||||||
Term::Var(ref vr, ref name) => {
|
Term::Var(ref vr, ref name) => {
|
||||||
@@ -679,10 +682,13 @@ impl CodeGenerator {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
InlinedClauseType::IsNumber(..) => match terms[0] {
|
InlinedClauseType::IsNumber(..) => match terms[0] {
|
||||||
Term::Literal(_, Literal::F64(..))
|
Term::Literal(
|
||||||
| Term::Literal(_, Literal::Rational(_))
|
_,
|
||||||
| Term::Literal(_, Literal::Integer(_))
|
Literal::F64(..)
|
||||||
| Term::Literal(_, Literal::Fixnum(_)) => {
|
| Literal::Rational(_)
|
||||||
|
| Literal::Integer(_)
|
||||||
|
| Literal::Fixnum(_),
|
||||||
|
) => {
|
||||||
instr!("$succeed")
|
instr!("$succeed")
|
||||||
}
|
}
|
||||||
Term::Var(ref vr, ref name) => {
|
Term::Var(ref vr, ref name) => {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ test_queries_on_builtins :-
|
|||||||
\+ float([1,2,_]),
|
\+ float([1,2,_]),
|
||||||
\+ (X is 3 rdiv 4, float(X)),
|
\+ (X is 3 rdiv 4, float(X)),
|
||||||
\+ \+ (X is 3 rdiv 4, rational(X)),
|
\+ \+ (X is 3 rdiv 4, rational(X)),
|
||||||
\+ rational(3),
|
rational(3),
|
||||||
\+ rational(f(_)),
|
\+ rational(f(_)),
|
||||||
\+ rational("sdfa"),
|
\+ rational("sdfa"),
|
||||||
\+ rational(atom),
|
\+ rational(atom),
|
||||||
|
|||||||
Reference in New Issue
Block a user