These predicates test the type associated with a term.
A goal executing any of these predicates simply succeeds or fails; there is no side effect, unification, or error.
var/1
var(X)
is true iff
X
is a member of the variable set as defined by the specification.
Templates and modes for the predicate are as follows:
var(@term)
Let's start with some simple tests verifying success of failure of single goals.
Goal | Theory | success(String goal,String theory) |
---|---|---|
var(Foo). | null | true |
var(_). | null | true |
Goal | Theory | success(String goal,String theory) |
---|---|---|
var(foo). | null | false |
foo = Foo, var(Foo). | null | false |
foo=Bar, var(Bar). | null | false |
atom/1
atom(X)
is true iff
X
is a member of the atom set as defined by the specification.
Templates and modes for the predicate are as follows:
atom(@term)
Let's start with some simple tests verifying success of failure of single goals.
Goal | Theory | success(String goal,String theory) |
---|---|---|
atom(atom). | null | true |
atom('string'). | null | true |
atom([]). | null | true |
Goal | Theory | success(String goal,String theory) |
---|---|---|
atom(a(b)). | null | false |
atom(Var). | null | false |
atom(6). | null | false |
atom(3.3). | null | false |
integer/1
integer(X)
is true iff
X
is a member of the integer set as defined by the specification.
Templates and modes for the predicate are as follows:
integer(@term)
Let's start with some simple tests verifying success of failure of single goals.
Goal | Theory | success(String goal,String theory) |
---|---|---|
integer(6). | null | true |
integer(-3). | null | true |
Goal | Theory | success(String goal,String theory) |
---|---|---|
integer(3.3). | null | false |
integer(X). | null | false |
integer(atom). | null | false |
float/1
float(X)
is true iff
X
is a member of the float set as defined by the specification.
Templates and modes for the predicate are as follows:
float(@term)
Let's start with some simple tests verifying success of failure of single goals.
Goal | Theory | success(String goal,String theory) |
---|---|---|
float(3.3). | null | true |
float(-3.3). | null | true |
Goal | Theory | success(String goal,String theory) |
---|---|---|
float(atom). | null | false |
float(X1). | null | false |
atomic/1
atomic(X)
is true if
X
is an atom, integer or float, and is false if
X
is a variable or a compound term, w.r.t every set as defined by the
specification.
Templates and modes for the predicate are as follows:
atomic(@term)
Let's start with some simple tests verifying success of failure of single goals.
Goal | Theory | success(String goal,String theory) |
---|---|---|
atomic(atom). | null | true |
atomic(2.3). | null | true |
Goal | Theory | success(String goal,String theory) |
---|---|---|
atomic(a(b)). | null | false |
atomic(V1). | null | false |
compound/1
compound(X)
is true iff
X
is a member of the compound term set as defined by the specification.
Templates and modes for the predicate are as follows:
compound(@term)
Let's start with some simple tests verifying success of failure of single goals.
Goal | Theory | success(String goal,String theory) |
---|---|---|
compound(-a). | null | true |
compound(a(b)). | null | true |
compound([a]). | null | true |
Goal | Theory | success(String goal,String theory) |
---|---|---|
compound(33.3). | null | false |
compound(-33.3). | null | false |
compound(_). | null | false |
compound(a). | null | false |
compound([]). | null | false |
nonvar/1
nonvar(X)
is true iff
X
is not a member of the variable set as defined by the specification.
Templates and modes for the predicate are as follows:
nonvar(@term)
Let's start with some simple tests verifying success of failure of single goals.
Goal | Theory | success(String goal,String theory) |
---|---|---|
nonvar(33.3). | null | true |
nonvar(foo). | null | true |
foo = Baz, nonvar(Baz). | null | true |
nonvar(a(b)). | null | true |
Goal | Theory | success(String goal,String theory) |
---|---|---|
nonvar(_). | null | false |
nonvar(FOO). | null | false |
number/1
number(X)
is true if
X
is an integer or float, and is false if
X
is a variable, an atom or a compound term, w.r.t every set as defined
by the specification.
Templates and modes for the predicate are as follows:
number(@term)
Let's start with some simple tests verifying success of failure of single goals.
Goal | Theory | success(String goal,String theory) |
---|---|---|
number(3). | null | true |
number(3.3). | null | true |
number(-3). | null | true |
Goal | Theory | success(String goal,String theory) |
---|---|---|
number(a). | null | false |
number(X). | null | false |