]>
Commit | Line | Data |
---|---|---|
92c4a786 | 1 | #ifndef __constraint_h__ |
bf92e32c | 2 | |
92c4a786 | 3 | #define __constraint_h__ |
bf92e32c | 4 | |
d0e5b01f | 5 | typedef enum |
6 | { | |
7 | LT, LTE, GT, GTE, EQ, NONNEGATIVE, POSITIVE | |
8 | } | |
9 | arithType; | |
10 | ||
4cccc6ad | 11 | struct _constraint { |
bf92e32c | 12 | constraint orig; |
90bc41f7 | 13 | constraint or; |
361091cc | 14 | constraintExpr lexpr; |
4cccc6ad | 15 | arithType ar; |
361091cc | 16 | constraintExpr expr; |
4cccc6ad | 17 | bool post; |
d46ce6a4 | 18 | /*@kept@*/ exprNode generatingExpr; |
d0e5b01f | 19 | } ; |
20 | ||
6e88de2d | 21 | /*@constant null constraint constraint_undefined; @*/ |
92c4a786 | 22 | |
6e88de2d | 23 | # define constraint_undefined ((constraint)NULL) |
4cccc6ad | 24 | |
6e88de2d | 25 | extern /*@falsenull@*/ bool constraint_isDefined (constraint p_e) /*@*/ ; |
26 | extern /*@unused@*/ /*@truenull@*/ bool constraint_isUndefined (constraint p_e) /*@*/ ; | |
84c9ffbf | 27 | extern /*@truenull@*/ /*@unused@*/ bool constraint_isError (constraint p_e) /*@*/ ; |
93307a76 | 28 | |
6e88de2d | 29 | # define constraint_isDefined(e) ((e) != constraint_undefined) |
30 | # define constraint_isUndefined(e) ((e) == constraint_undefined) | |
31 | # define constraint_isError(e) ((e) == constraint_undefined) | |
93307a76 | 32 | |
d46ce6a4 | 33 | void constraint_free (/*@only@*/ /*@notnull@*/ constraint c); |
4cccc6ad | 34 | |
bb25bea6 | 35 | //constraint makeConstraintParse (sRef x, lltok relOp, exprNode cconstant); |
4cccc6ad | 36 | |
37 | /*@i22*/ | |
38 | /*@-czechfcns*/ | |
4cccc6ad | 39 | |
6e88de2d | 40 | ///*@special@*/ constraintExpr makeConstraintExpr (/*@only@*/ /*@notnull@*/ constraintTerm term) |
41 | // /*@post:isnull result->expr@*/ | |
42 | // /*@post:notnull result->t1@*/ | |
43 | // /*@defines result->expr, result->t1, result->c1@, result->op*/; | |
4cccc6ad | 44 | |
84c9ffbf | 45 | //constraintExpr makeConstraintExprIntlit (int p_i); |
4cccc6ad | 46 | |
47 | /*@relnull@*/ constraint constraint_makeReadSafeExprNode ( exprNode p_po, exprNode p_ind); | |
48 | ||
d46ce6a4 | 49 | /*@only@*/ constraint constraint_makeWriteSafeExprNode (exprNode p_po, exprNode p_ind); |
4cccc6ad | 50 | |
d46ce6a4 | 51 | /*@only@*/ constraint constraint_makeReadSafeInt (exprNode p_t1, int p_index); |
4cccc6ad | 52 | |
d46ce6a4 | 53 | /*@only@*/ constraint constraint_makeEnsureMaxReadAtLeast (exprNode p_t1, exprNode p_t2, fileloc p_sequencePoint); |
4cccc6ad | 54 | |
d46ce6a4 | 55 | void constraint_overWrite (constraint c1, /*@observer@*/ constraint c2) /*@modifies c1 @*/; |
4cccc6ad | 56 | |
d46ce6a4 | 57 | /*@only@*/ constraint constraint_copy (/*@observer@*/ constraint c); |
4cccc6ad | 58 | |
84c9ffbf | 59 | //constraintExpr makePostOpInc (exprNode t1); |
4cccc6ad | 60 | |
61 | ||
d46ce6a4 | 62 | bool fileloc_closer (/*@observer@*/ fileloc loc1,/*@observer@*/ fileloc loc2,/*@observer@*/ fileloc loc3) /*@*/; |
63 | ||
ef2aa32a | 64 | |
d46ce6a4 | 65 | /*@only@*/ cstring arithType_print (arithType ar) /*@*/; |
4cccc6ad | 66 | |
4cccc6ad | 67 | |
d46ce6a4 | 68 | /*@only@*/fileloc constraint_getFileloc (constraint c); |
69 | /*@only@*/ cstring constraint_print (constraint c) /*@*/; | |
ef2aa32a | 70 | |
d46ce6a4 | 71 | /*@only@*/constraint constraint_makeWriteSafeInt (exprNode po, int ind); |
754746a0 | 72 | |
d46ce6a4 | 73 | exprNode exprNode_copyConstraints (/*@returned@*/ exprNode dst, exprNode src) /*@modifies dst @*/; |
754746a0 | 74 | |
d46ce6a4 | 75 | /*@only@*/ constraint constraint_makeEnsureEqual (exprNode e1, exprNode e2, fileloc sequencePoint); |
754746a0 | 76 | |
d46ce6a4 | 77 | /*@only@*/ constraint constraint_makeMaxSetSideEffectPostIncrement (exprNode e, fileloc sequencePoint); |
754746a0 | 78 | |
d46ce6a4 | 79 | constraint constraint_preserveOrig (/*@returned@*/ constraint c) /*@modifies c @*/; |
dc92450f | 80 | /*@only@*/ constraint constraint_doSRefFixBaseParam (/*@returned@*/ /*@only@*/ constraint precondition, |
d46ce6a4 | 81 | exprNodeList arglist); |
93307a76 | 82 | |
d46ce6a4 | 83 | /*@only@*/ cstring constraint_printDetailed (constraint c); |
93307a76 | 84 | |
d46ce6a4 | 85 | /*@only@*/ constraint constraint_makeEnsureLessThan (exprNode e1, exprNode e2, fileloc sequencePoint); |
34f0c5e7 | 86 | |
d46ce6a4 | 87 | /*@only@*/ constraint constraint_makeEnsureLessThanEqual (exprNode e1, exprNode e2, fileloc sequencePoint); |
88 | ||
89 | /*@only@*/ constraint constraint_makeEnsureGreaterThan (exprNode e1, exprNode e2, fileloc sequencePoint); | |
90 | /*@only@*/ constraint constraint_makeEnsureGreaterThanEqual (exprNode e1, exprNode e2, fileloc sequencePoint); | |
34f0c5e7 | 91 | |
92 | /*drl add 11/28/2000 */ | |
d46ce6a4 | 93 | /*@only@*/ constraint constraint_makeSRefWriteSafeInt (sRef s, int ind); |
94 | /*@unused@*/ /*@only@*/ constraint constraint_makeSRefReadSafeInt (sRef s, int ind); | |
ef2aa32a | 95 | /*drl add 11/26/2000 */ |
d46ce6a4 | 96 | void constraint_printError (/*@observer@*/ constraint c, /*@observer@*/ fileloc loc); |
97 | ||
98 | /*@only@*/ constraint constraint_doSRefFixConstraintParam (constraint precondition, | |
ef2aa32a | 99 | exprNodeList arglist); |
100 | ||
d46ce6a4 | 101 | /*@only@*/ constraint constraint_makeSRefSetBufferSize (sRef s, long int size); |
102 | ||
103 | /*@only@*/ constraint constraint_doFixResult (constraint postcondition, exprNode fcnCall); | |
ef2aa32a | 104 | |
d46ce6a4 | 105 | /*@only@*/ constraint constraint_makeEnsureLteMaxRead(exprNode index, exprNode buffer); |
ef2aa32a | 106 | |
d46ce6a4 | 107 | /*@only@*/ constraint constraint_makeMaxSetSideEffectPostDecrement (exprNode e, fileloc sequencePoint); |
ef2aa32a | 108 | |
97e4a647 | 109 | bool constraint_search (constraint c, constraintExpr old); |
103db890 | 110 | |
d46ce6a4 | 111 | /*@only@*/ constraint makeConstraintParse3 (constraintExpr l, lltok relOp, constraintExpr r); |
103db890 | 112 | |
113 | constraint constraint_addGeneratingExpr (/*@returned@*/ constraint c, exprNode e); | |
114 | ||
115 | bool constraint_hasMaxSet(constraint c); | |
116 | ||
470b7798 | 117 | /*from constraintGenreation.c*/ |
bb25bea6 | 118 | void exprNode_exprTraverse (exprNode e, bool definatelv, bool definaterv, /*@observer@*/ fileloc sequencePoint); |
470b7798 | 119 | |
d46ce6a4 | 120 | /*@only@*/ constraintList exprNode_traversRequiresConstraints (exprNode e); |
121 | /*@only@*/ constraintList exprNode_traversEnsuresConstraints (exprNode e); | |
470b7798 | 122 | |
84c9ffbf | 123 | constraint constraint_togglePost (/*@returned@*/ constraint c); |
470b7798 | 124 | |
d46ce6a4 | 125 | /*@only@*/ cstring constraint_printOr (constraint c) /*@*/; |
126 | ||
4cccc6ad | 127 | /*@=czechfcns*/ |
ef2aa32a | 128 | //#warning take this out |
d0e5b01f | 129 | |
754746a0 | 130 | #include "constraintResolve.h" |
dc92450f | 131 | #include "constraintOutput.h" |
132 | ||
6e88de2d | 133 | #else |
134 | ||
135 | #error Multiple include | |
136 | ||
92c4a786 | 137 | #endif |
d0e5b01f | 138 |