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 bool increments (/*@observer@*/ constraint c, /*@observer@*/ constraintExpr var) { llassert (constraint_isDefined (c) ); if (constraint_isUndefined (c) ) { return FALSE; } llassert (incVar (c)); if (constraintExpr_similar (c->lexpr, var) ) return TRUE; else return FALSE; }
static /*@only@*/ constraintList getLessThanConstraints (/*@observer@*/ constraintList c) { constraintList ret; ret = constraintList_makeNew (); constraintList_elements (c, el) { llassert (constraint_isDefined (el)); if ( constraint_isUndefined (el) ) continue; if (el->ar == LT || el->ar == LTE) { constraint temp; temp = constraint_copy (el); ret = constraintList_add (ret, temp); } }