summaryrefslogtreecommitdiff
path: root/types.c
diff options
context:
space:
mode:
Diffstat (limited to 'types.c')
-rw-r--r--types.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/types.c b/types.c
index 6f2b33d..0e70abf 100644
--- a/types.c
+++ b/types.c
@@ -38,6 +38,20 @@ isnonemptylist(Term *t)
return 0;
}
+int
+ispredicateindicator(Term *t, int allowvars)
+{
+ if(t->tag == CompoundTerm && runestrcmp(t->text, L"/") == 0 && t->arity == 2){
+ Term *f = t->children;
+ Term *a = f->next;
+ if(allowvars)
+ return (f->tag == VariableTerm || f->tag == AtomTerm) && (a->tag == VariableTerm || a->tag == IntegerTerm);
+ else
+ return (f->tag == AtomTerm) && (a->tag == IntegerTerm);
+ }else
+ return 0;
+}
+
/* Other functions */
Term *
listhead(Term *t)