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