- if (c != NULL)
- {
-
- DPRINTF ( (message ("Function preconditions are %s \n\n\n\n\n", constraintList_printDetailed (c) ) ) );
-
- body->requiresConstraints = reflectChangesFreePre (body->requiresConstraints, c);
-
- c2 = constraintList_copy (c);
- fix = constraintList_makeFixedArrayConstraints (body->uses);
- c2 = reflectChangesFreePre (c2, fix);
- constraintList_free(fix);
- if ( context_getFlag (FLG_ORCONSTRAINT) )
- {
- t = reflectChangesOr (body->requiresConstraints, c2 );
- }
- else
- {
- t = reflectChanges (body->requiresConstraints, c2);
- }
-
- constraintList_free(body->requiresConstraints);
- DPRINTF ( (message ("The body has the required constraints: %s", constraintList_printDetailed (t) ) ) );
-
- body->requiresConstraints = t;
-
- t = constraintList_mergeEnsures (c, body->ensuresConstraints);
- constraintList_free(body->ensuresConstraints);
-
- body->ensuresConstraints = t;
-
- DPRINTF ( (message ("The body has the ensures constraints: %s", constraintList_printDetailed (t) ) ) );
- constraintList_free(c2);
- }
-
- if (c != NULL)
- {
- DPRINTF((message ("The Function %s has the preconditions %s", uentry_unparse(ue), constraintList_printDetailed(c) ) ) );
- }
- else
- {
- DPRINTF((message ("The Function %s has no preconditions", uentry_unparse(ue) ) ) );
- }
+ if (constraintList_isDefined(c) )
+ {
+ DPRINTF ((message ("Function preconditions are %s \n\n\n\n\n", constraintList_printDetailed (c) ) ) );
+
+ body->requiresConstraints = constraintList_reflectChangesFreePre (body->requiresConstraints, c);
+
+ c2 = constraintList_copy (c);
+ fix = constraintList_makeFixedArrayConstraints (body->uses);
+ c2 = constraintList_reflectChangesFreePre (c2, fix);
+ constraintList_free (fix);
+
+ if (context_getFlag (FLG_ORCONSTRAINT))
+ {
+ t = constraintList_reflectChangesOr (body->requiresConstraints, c2 );
+ }
+ else
+ {
+ t = constraintList_reflectChanges(body->requiresConstraints, c2);
+ }
+
+ constraintList_free (body->requiresConstraints);
+ DPRINTF ((message ("The body has the required constraints: %s", constraintList_printDetailed (t) ) ) );
+
+ body->requiresConstraints = t;
+
+ t = constraintList_mergeEnsures (c, body->ensuresConstraints);
+ constraintList_free(body->ensuresConstraints);
+
+ body->ensuresConstraints = t;
+
+ DPRINTF ((message ("The body has the ensures constraints: %s", constraintList_printDetailed (t) ) ) );
+ constraintList_free(c2);
+ }
+
+ if (constraintList_isDefined(c))
+ {
+ DPRINTF ((message ("The Function %s has the preconditions %s",
+ uentry_unparse(ue), constraintList_printDetailed(c))));
+ }
+ else
+ {
+ DPRINTF((message ("The Function %s has no preconditions", uentry_unparse(ue))));
+ }
+
+ implicitFcnConstraints = getImplicitFcnConstraints();
+
+ if (constraintList_isDefined(implicitFcnConstraints) )
+ {
+ if (context_getFlag (FLG_IMPLICTCONSTRAINT) )
+ {
+ body->requiresConstraints = constraintList_reflectChangesFreePre (body->requiresConstraints,
+ implicitFcnConstraints );
+ }
+ }
+
+ body->requiresConstraints = constraintList_sort (body->requiresConstraints);
+
+ constraintList_printError(body->requiresConstraints, g_currentloc);
+
+ post = uentry_getFcnPostconditions (ue);
+
+ if (context_getFlag (FLG_CHECKPOST))
+ {
+ if (constraintList_isDefined (post))
+ {
+ constraintList post2;
+
+ DPRINTF ((message ("The declared function postconditions are %s \n\n\n\n\n",
+ constraintList_printDetailed (post) ) ) );
+
+ post = constraintList_reflectChangesFreePre (post, body->ensuresConstraints);
+
+ post2 = constraintList_copy (post);
+ fix = constraintList_makeFixedArrayConstraints (body->uses);
+ post2 = constraintList_reflectChangesFreePre (post2, fix);
+ constraintList_free(fix);
+ if ( context_getFlag (FLG_ORCONSTRAINT) )
+ {
+ t = constraintList_reflectChangesOr (post2, body->ensuresConstraints);
+ }
+ else
+ {
+ t = constraintList_reflectChanges(post2, body->ensuresConstraints);
+ }
+
+ constraintList_free(post2);
+ constraintList_free(post);
+ post = t;