]>
Commit | Line | Data |
---|---|---|
4cccc6ad | 1 | /* |
2 | ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2000. | |
3 | ** See ../LICENSE for license information. | |
4 | */ | |
5 | # ifndef constraintLIST_H | |
6 | # define constraintLIST_H | |
7 | ||
84c9ffbf | 8 | typedef /*@only@*/ /*@notnull@*/ constraint o_constraint; |
4cccc6ad | 9 | |
28bf4b0b | 10 | struct s_constraintList |
4cccc6ad | 11 | { |
12 | int nelements; | |
13 | int nspace; | |
14 | /*@reldef@*/ /*@relnull@*/ o_constraint *elements; | |
93307a76 | 15 | } ; |
16 | ||
17 | /*@constant null constraintList constraintList_undefined;@*/ | |
84c9ffbf | 18 | |
19 | # define constraintList_undefined ((constraintList)NULL) | |
20 | ||
0e41eb0e | 21 | extern /*@falsewhennull@*/ bool constraintList_isDefined (constraintList p_e) /*@*/ ; |
22 | extern /*@unused@*/ /*@nullwhentrue@*/ bool constraintList_isUndefined (constraintList p_e) /*@*/ ; | |
23 | extern /*@nullwhentrue@*/ /*@unused@*/ bool constraintList_isError (constraintList p_e) /*@*/ ; | |
84c9ffbf | 24 | |
25 | # define constraintList_isDefined(e) ((e) != constraintList_undefined) | |
26 | # define constraintList_isUndefined(e) ((e) == constraintList_undefined) | |
27 | # define constraintList_isError(e) ((e) == constraintList_undefined) | |
28 | ||
a779b61e | 29 | extern bool constraintList_isEmpty (/*@sef@*/ constraintList p_e) /*@*/; |
30 | ||
31 | # define constraintList_isEmpty(e) ( (constraintList_isUndefined((e)) ) ||( ( (e)->nelements == 0) ) ) | |
32 | ||
3814599d | 33 | extern constraintList constraintList_single (/*@only@*/ constraint) ; |
34 | ||
35 | extern constraintList constraintList_addListFree (/*@returned@*/ constraintList, /*@only@*/ constraintList) ; | |
28bf4b0b | 36 | extern constraintList constraintList_preserveCallInfo (/*@returned@*/ constraintList p_c, /*@observer@*/ /*@dependent@*/ exprNode p_fcn) ; |
4cccc6ad | 37 | |
38 | /*@iter constraintList_elements (sef constraintList x, yield exposed constraint el); @*/ | |
39 | # define constraintList_elements(x, m_el) \ | |
60eced23 | 40 | { if (constraintList_isDefined (x)) { int m_ind; constraint *m_elements = &((x)->elements[0]); \ |
4cccc6ad | 41 | for (m_ind = 0 ; m_ind < (x)->nelements; m_ind++) \ |
42 | { constraint m_el = *(m_elements++); | |
43 | ||
60eced23 | 44 | # define end_constraintList_elements }}} |
4cccc6ad | 45 | |
6e88de2d | 46 | extern /*@only@*/ constraintList constraintList_makeNew(void) /*@*/; |
47 | extern constraintList constraintList_add (/*@returned@*/ constraintList p_s, /*@only@*/ constraint p_el) /*@modifies p_s@*/ ; | |
4cccc6ad | 48 | |
28bf4b0b | 49 | extern /*@only@*/ constraintList constraintList_addList (/*@only@*/ /*@returned@*/ constraintList p_s, /*@observer@*/ constraintList p_newList) /*@modifies p_s@*/ ; |
361091cc | 50 | |
51 | ||
28bf4b0b | 52 | extern constraintList constraintList_copy ( /*@observer@*/ /*@temp@*/ constraintList p_s) /*@*/ ; |
4cccc6ad | 53 | |
4cccc6ad | 54 | |
920a3797 | 55 | extern void constraintList_free (/*@only@*/ constraintList p_s) ; |
361091cc | 56 | |
ef2aa32a | 57 | |
920a3797 | 58 | extern /*@only@*/ cstring constraintList_unparse ( /*@observer@*/ constraintList p_s) /*@*/; |
361091cc | 59 | |
28bf4b0b | 60 | /*@only@*/ extern cstring constraintList_print ( /*@observer@*/ /*@temp@*/ constraintList p_s) /*@*/; |
754746a0 | 61 | |
62 | extern cstring | |
28bf4b0b | 63 | constraintList_printDetailed ( /*@observer@*/ constraintList p_s) /*@*/; |
754746a0 | 64 | |
84c9ffbf | 65 | extern /*@only@*/ constraintList |
28bf4b0b | 66 | constraintList_logicalOr ( /*@observer@*/ constraintList p_l1, /*@observer@*/ constraintList p_l2); |
754746a0 | 67 | |
28bf4b0b | 68 | extern constraintList constraintList_preserveOrig (/*@returned@*/ constraintList p_c); |
754746a0 | 69 | |
4cccc6ad | 70 | /*@constant int constraintListBASESIZE;@*/ |
754746a0 | 71 | |
84c9ffbf | 72 | # define constraintListBASESIZE SMALLBASESIZE |
73 | ||
28bf4b0b | 74 | extern /*@only@*/ constraintList constraintList_doSRefFixBaseParam ( constraintList p_preconditions, /*@temp@*/ /*@observer@*/ exprNodeList p_arglist) /*@modifies p_preconditions@*/; |
754746a0 | 75 | |
28bf4b0b | 76 | extern constraintList constraintList_togglePost (/*@returned@*/ constraintList p_c) /*@modifies p_c@*/; |
ef2aa32a | 77 | |
28bf4b0b | 78 | extern /*@only@*/ constraintList constraintList_doSRefFixConstraintParam ( /*@only@*/ constraintList p_preconditions, /*@observer@*/ /*@temp@*/ exprNodeList p_arglist) /*@modifies p_preconditions@*/; |
ef2aa32a | 79 | |
28bf4b0b | 80 | extern constraintList exprNode_getPostConditions (/*@dependent@*/ /*@observer@*/ exprNode p_fcn, exprNodeList p_arglist, /*@dependent@*/ /*@observer@*/ exprNode p_fcnCall) /*@*/; |
ef2aa32a | 81 | |
28bf4b0b | 82 | /*@only@*/ constraintList constraintList_doFixResult ( /*@only@*/ constraintList p_postconditions, /*@observer@*/ /*@dependent@*/ exprNode p_fcnCall) /*@modifies p_postconditions@*/; |
103db890 | 83 | |
28bf4b0b | 84 | extern constraintList constraintList_addGeneratingExpr (/*@returned@*/ constraintList p_c, /*@dependent@*/ /*@observer@*/ exprNode p_e) /*@modifies p_c@*/; |
920a3797 | 85 | extern /*@only@*/ constraintList constraintList_makeFixedArrayConstraints ( /*@observer@*/ sRefSet p_s) ; |
2934b455 | 86 | extern void constraintList_printErrorPostConditions (constraintList p_s, fileloc p_loc) ; |
28bf4b0b | 87 | extern void constraintList_printError (constraintList p_s, /*@observer@*/ fileloc p_loc) ; |
4cccc6ad | 88 | |
6970c11b | 89 | extern constraintList constraintList_sort (/*@returned@*/ constraintList p_ret) /*@modifes p_ref@*/ ; |
90 | ||
28bf4b0b | 91 | void constraintList_dump (/*@observer@*/ constraintList p_c, FILE * p_f); |
920a3797 | 92 | |
28bf4b0b | 93 | /*@only@*/ constraintList constraintList_undump (FILE * p_f); |
7edb30e6 | 94 | /*@only@*/ constraintList constraintList_removeSurpressed (/*@only@*/ constraintList p_s); |
920a3797 | 95 | |
4cccc6ad | 96 | # else |
97 | # error "Multiple include" | |
98 | # endif | |
99 | ||
100 | ||
101 | ||
102 |