+ DPRINTF (("\n\n\n\n\n\n\n"));
+
+ 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;
+
+ printf("Unresolved post conditions\n");
+ constraintList_printErrorPostConditions(post, g_currentloc);
+ }
+ }
+
+ if (constraintList_isDefined (post))
+ {
+ constraintList_free (post);
+ }
+
+ body->ensuresConstraints = constraintList_sort(body->ensuresConstraints);
+
+ if ( context_getFlag (FLG_FUNCTIONPOST) )
+ {
+ constraintList_printError(body->ensuresConstraints, g_currentloc);
+ }
+
+ /* ConPrint (message ("Unable to resolve function constraints:\n%s", constraintList_printDetailed(body->requiresConstraints) ), g_currentloc);
+
+ ConPrint (message ("Splint has found function post conditions:\n%s", constraintList_printDetailed(body->ensuresConstraints) ), g_currentloc);
+
+ printf ("The required constraints are:\n%s", constraintList_printDetailed(body->requiresConstraints) );
+ printf ("The ensures constraints are:\n%s", constraintList_printDetailed(body->ensuresConstraints) );
+ */
+
+ if (constraintList_isDefined(c) )
+ constraintList_free(c);
+
+ context_exitInnerPlain();
+
+ /*is it okay not to free this?*/