diff --git a/code/function-contract/behaviors/ex-3-triangle-answer.c b/code/function-contract/behaviors/ex-3-triangle-answer.c index 4e63535..7a04bdf 100644 --- a/code/function-contract/behaviors/ex-3-triangle-answer.c +++ b/code/function-contract/behaviors/ex-3-triangle-answer.c @@ -5,6 +5,7 @@ enum Angles { RIGHT, ACUTE, OBTUSE }; /*@ requires 0 <= a && 0 <= b && 0 <= c; + requires a <= b+c; requires a >= b && a >= c; // Note that this condition is not // necessary for the function but // added for this exercise diff --git a/code/function-contract/modularity/ex-5-triangle-answer.c b/code/function-contract/modularity/ex-5-triangle-answer.c index 54c67ce..adb4c07 100644 --- a/code/function-contract/modularity/ex-5-triangle-answer.c +++ b/code/function-contract/modularity/ex-5-triangle-answer.c @@ -9,6 +9,9 @@ struct TriangleInfo { }; /*@ + requires 0 <= a && 0 <= b && 0 <= c; + requires a <= b+c; + assigns \nothing; behavior equilateral: