diff options
Diffstat (limited to 'types.c')
-rw-r--r-- | types.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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) |