add more type predicates.

This commit is contained in:
Mark Thom
2018-02-05 20:10:41 -07:00
parent 8326a573d9
commit 9d5f897fed
10 changed files with 232 additions and 8 deletions

View File

@@ -341,8 +341,13 @@ pub enum Term {
pub enum InlinedQueryTerm {
CompareNumber(CompareNumberQT, Vec<Box<Term>>),
IsAtomic(Vec<Box<Term>>),
IsVar(Vec<Box<Term>>),
IsInteger(Vec<Box<Term>>)
IsCompound(Vec<Box<Term>>),
IsInteger(Vec<Box<Term>>),
IsRational(Vec<Box<Term>>),
IsString(Vec<Box<Term>>),
IsFloat(Vec<Box<Term>>),
IsNonVar(Vec<Box<Term>>),
IsVar(Vec<Box<Term>>),
}
impl InlinedQueryTerm {
@@ -350,6 +355,11 @@ impl InlinedQueryTerm {
match self {
&InlinedQueryTerm::CompareNumber(_, _) => 2,
&InlinedQueryTerm::IsAtomic(_) => 1,
&InlinedQueryTerm::IsCompound(_) => 1,
&InlinedQueryTerm::IsFloat(_) => 1,
&InlinedQueryTerm::IsRational(_) => 1,
&InlinedQueryTerm::IsString(_) => 1,
&InlinedQueryTerm::IsNonVar(_) => 1,
&InlinedQueryTerm::IsInteger(_) => 1,
&InlinedQueryTerm::IsVar(_) => 1,
}
@@ -800,7 +810,12 @@ pub enum BuiltInInstruction {
InstallNewBlock,
InternalCallN,
IsAtomic(RegType),
IsInteger(RegType),
IsCompound(RegType),
IsFloat(RegType),
IsInteger(RegType),
IsNonVar(RegType),
IsRational(RegType),
IsString(RegType),
IsVar(RegType),
ResetBlock,
SetBall,