+void constraint_printErrorPostCondition (constraint c, fileloc loc)
+{
+ cstring string;
+ fileloc errorLoc, temp;
+
+ string = constraint_printDetailedPostCondition (c);
+
+ errorLoc = loc;
+
+ loc = NULL;
+
+ temp = constraint_getFileloc(c);
+
+ if (fileloc_isDefined(temp) )
+ {
+ errorLoc = temp;
+ voptgenerror ( FLG_CHECKPOST, string, errorLoc);
+ fileloc_free(temp);
+ }
+ else
+ {
+ voptgenerror ( FLG_CHECKPOST, string, errorLoc);
+ }
+}
+
+
+
+
+void constraint_printError (constraint c, fileloc loc)
+{
+ cstring string;
+ fileloc errorLoc, temp;
+
+ string = constraint_printDetailed (c);
+
+ errorLoc = loc;
+
+ loc = NULL;
+
+ temp = constraint_getFileloc(c);
+
+ if (fileloc_isDefined(temp) )
+ {
+ errorLoc = temp;
+
+ if (c->post)
+ {
+ voptgenerror (FLG_FUNCTIONPOST, string, errorLoc);
+ }
+ else
+ {
+ voptgenerror (FLG_FUNCTIONCONSTRAINT, string, errorLoc);
+ }
+ fileloc_free(temp);
+ }
+ else
+ {
+ if (c->post)
+ {
+ voptgenerror (FLG_FUNCTIONPOST, string, errorLoc);
+ }
+ else
+ {
+ voptgenerror (FLG_FUNCTIONCONSTRAINT, string, errorLoc);
+ }
+ }
+}
+
+
+cstring constraint_printDeep (constraint c)
+{
+ cstring st = cstring_undefined;
+
+ st = constraint_print(c);
+
+ if (c->orig != constraint_undefined)
+ {
+ if (!c->post)
+ {
+ if (c->orig->fcnPre)
+ st = cstring_concatFree(st, (message(" derived from %s precondition: %q", exprNode_unparse(c->orig->generatingExpr), constraint_printDeep(c->orig) )
+ ) );
+ else
+ st = cstring_concatFree(st,(message(" needed to satisfy %q",
+ constraint_printDeep(c->orig) )
+ ) );
+
+ }
+ else
+ {
+ st = cstring_concatFree(st,(message("derived from: %q",
+ constraint_printDeep(c->orig) )
+ ) );
+ }
+ }
+
+ return st;
+
+}
+
+
+static /*@only@*/ cstring constraint_printDetailedPostCondition (/*@observer@*/ /*@temp@*/ constraint c)
+{
+ cstring st = cstring_undefined;
+
+ st = message ("Unsatisfied ensures constraint condition:\nLCLint is unable to verify the constraint %q", constraint_printDeep (c) );
+
+ if (context_getFlag (FLG_CONSTRAINTLOCATION) )
+ {
+ cstring temp;
+ // llassert (c->generatingExpr);
+ temp = message ("\nOriginal Generating expression %q: %s\n", fileloc_unparse( exprNode_getfileloc (c->generatingExpr) ),
+ exprNode_unparse(c->generatingExpr) );
+ st = cstring_concatFree (st, temp);
+
+ if (constraint_hasMaxSet(c) )
+ {
+ temp = message ("Has MaxSet\n");
+ st = cstring_concatFree (st, temp);
+ }
+ }
+ return st;
+}