+int constraint_compare (/*@observer@*/ /*@temp@*/ const constraint * c1, /*@observer@*/ /*@temp@*/ const constraint * c2) /*@*/
+{
+ fileloc loc1, loc2;
+
+ int ret;
+
+ llassert(constraint_isDefined(*c1) );
+ llassert(constraint_isDefined(*c2) );
+
+ if (constraint_isUndefined(*c1) )
+ {
+ if (constraint_isUndefined(*c2) )
+ return 0;
+ else
+ return 1;
+ }
+
+ if (constraint_isUndefined(*c2) )
+ {
+ return -1;
+ }
+
+ loc1 = constraint_getFileloc(*c1);
+ loc2 = constraint_getFileloc(*c2);
+
+ ret = fileloc_compare(loc1, loc2);
+
+ fileloc_free(loc1);
+ fileloc_free(loc2);
+
+ return ret;
+}
+
+
+bool constraint_isPost (/*@observer@*/ /*@temp@*/ constraint c)
+{
+ llassert(constraint_isDefined(c) );
+
+ if (constraint_isUndefined(c) )
+ return FALSE;
+
+ return (c->post);
+}
+
+
+static int constraint_getDepth(/*@observer@*/ /*@temp@*/ constraint c)
+{
+ int l , r;
+
+ l = constraintExpr_getDepth(c->lexpr);
+ r = constraintExpr_getDepth(c->expr);
+
+ if (l > r)
+ {
+ DPRINTF(( message("constraint depth returning %d for %s", l, constraint_print(c) ) ));
+ return l;
+ }
+ else
+ {
+ DPRINTF(( message("constraint depth returning %d for %s", r, constraint_print(c) ) ));
+ return r;
+ }
+}
+
+
+bool constraint_tooDeep (/*@observer@*/ /*@temp@*/ constraint c)
+{
+ int temp;
+
+ temp = constraint_getDepth(c);
+
+ if (temp >= 20 )
+ {
+ return TRUE;
+ }
+
+ return FALSE;
+
+}