File: declarations.ads

package info (click to toggle)
spark 2012.0.deb-9
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 29,260 kB
  • ctags: 3,098
  • sloc: ada: 186,243; cpp: 13,497; makefile: 685; yacc: 440; lex: 176; ansic: 119; sh: 16
file content (239 lines) | stat: -rw-r--r-- 9,450 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
-------------------------------------------------------------------------------
-- (C) Altran Praxis Limited
-------------------------------------------------------------------------------
--
-- The SPARK toolset is free software; you can redistribute it and/or modify it
-- under terms of the GNU General Public License as published by the Free
-- Software Foundation; either version 3, or (at your option) any later
-- version. The SPARK toolset is distributed in the hope that it will be
-- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-- Public License for more details. You should have received a copy of the GNU
-- General Public License distributed with the SPARK toolset; see file
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy of
-- the license.
--
--=============================================================================

with Cells;
with Dictionary;
with LexTokenManager;
with Pairs;
with SPARK_IO;

use type Cells.Cell;
use type Cells.Cell_Kind;
use type Cells.Cell_Rank;
use type Dictionary.Abstractions;
use type Dictionary.Symbol;
use type LexTokenManager.Str_Comp_Result;

--# inherit AdjustFDL_RWs,
--#         Cells,
--#         Cell_Storage,
--#         Clists,
--#         CommandLineData,
--#         CStacks,
--#         DAG_IO,
--#         Debug,
--#         Dictionary,
--#         ErrorHandler,
--#         ExaminerConstants,
--#         E_Strings,
--#         LexTokenManager,
--#         Lists,
--#         Maths,
--#         Pairs,
--#         Pile,
--#         SPARK_IO,
--#         SP_Symbols,
--#         Statistics,
--#         Symbol_Set,
--#         SystemErrors;

package Declarations
--# own State;
--# initializes State;
is

   type UsedSymbolIterator is private;
   NullIterator : constant UsedSymbolIterator;

   procedure Initialize (It : out UsedSymbolIterator);
   --# global in State;
   --# derives It from State;

   function CurrentNode (It : in UsedSymbolIterator) return Cells.Cell;

   function NextNode (Heap : in Cells.Heap_Record;
                      It   : in UsedSymbolIterator) return UsedSymbolIterator;

   function IsNullIterator (It : in UsedSymbolIterator) return Boolean;

   procedure StartProcessing (Heap : in out Cells.Heap_Record);
   --# global in out Statistics.TableUsage;
   --#           out State;
   --# derives Heap,
   --#         Statistics.TableUsage from *,
   --#                                    Heap &
   --#         State                 from Heap;

   procedure Add (Heap   : in out Cells.Heap_Record;
                  Symbol : in     Dictionary.Symbol);
   --# global in     Dictionary.Dict;
   --#        in out State;
   --#        in out Statistics.TableUsage;
   --# derives Heap,
   --#         State,
   --#         Statistics.TableUsage from *,
   --#                                    Dictionary.Dict,
   --#                                    Heap,
   --#                                    State,
   --#                                    Symbol;

   procedure AddAttribute (Heap     : in out Cells.Heap_Record;
                           TickCell : in     Cells.Cell);
   --# global in     Dictionary.Dict;
   --#        in     LexTokenManager.State;
   --#        in     State;
   --#        in out Statistics.TableUsage;
   --# derives Heap,
   --#         Statistics.TableUsage from *,
   --#                                    Dictionary.Dict,
   --#                                    Heap,
   --#                                    LexTokenManager.State,
   --#                                    State,
   --#                                    TickCell;

   procedure AddBitwiseOp (Heap   : in out Cells.Heap_Record;
                           OpCell : in     Cells.Cell);
   --# global in     Dictionary.Dict;
   --#        in out State;
   --#        in out Statistics.TableUsage;
   --# derives Heap,
   --#         State,
   --#         Statistics.TableUsage from *,
   --#                                    Dictionary.Dict,
   --#                                    Heap,
   --#                                    OpCell,
   --#                                    State;

   procedure AddProcedureExport (Heap       : in out Cells.Heap_Record;
                                 ExportCell : in     Cells.Cell);
   --# global in     Dictionary.Dict;
   --#        in     LexTokenManager.State;
   --#        in out State;
   --#        in out Statistics.TableUsage;
   --# derives Heap,
   --#         State,
   --#         Statistics.TableUsage from *,
   --#                                    Dictionary.Dict,
   --#                                    ExportCell,
   --#                                    Heap,
   --#                                    LexTokenManager.State,
   --#                                    State;

   procedure AddReturnVar (Heap          : in out Cells.Heap_Record;
                           ReturnVarCell : in     Cells.Cell);
   --# global in     Dictionary.Dict;
   --#        in out State;
   --#        in out Statistics.TableUsage;
   --# derives Heap,
   --#         State,
   --#         Statistics.TableUsage from *,
   --#                                    Dictionary.Dict,
   --#                                    Heap,
   --#                                    ReturnVarCell,
   --#                                    State;

   procedure AddUseOfRootInteger;
   --# global in out State;
   --# derives State from *;

   -- Traverses the DAG denoted by Root and adds all declarations
   -- needed by it.
   procedure Find_DAG_Declarations (Heap : in out Cells.Heap_Record;
                                    Root : in     Cells.Cell);
   --# global in     Dictionary.Dict;
   --#        in     LexTokenManager.State;
   --#        in out State;
   --#        in out Statistics.TableUsage;
   --# derives Heap,
   --#         State,
   --#         Statistics.TableUsage from *,
   --#                                    Dictionary.Dict,
   --#                                    Heap,
   --#                                    LexTokenManager.State,
   --#                                    Root,
   --#                                    State;

   -- Traverses the VC DAGs denoted by PredicatePair and adds all declarations
   -- needed by them. If IgnoreTriviallyTrueVCs is True, then VCs with all
   -- conclusions "True" are ignored, regardless of the hypotheses.
   procedure FindVCFormulaDeclarations
     (Heap                   : in out Cells.Heap_Record;
      PredicatePair          : in     Pairs.Pair;
      IgnoreTriviallyTrueVCs : in     Boolean);
   --# global in     Dictionary.Dict;
   --#        in     LexTokenManager.State;
   --#        in out State;
   --#        in out Statistics.TableUsage;
   --# derives Heap,
   --#         State,
   --#         Statistics.TableUsage from *,
   --#                                    Dictionary.Dict,
   --#                                    Heap,
   --#                                    IgnoreTriviallyTrueVCs,
   --#                                    LexTokenManager.State,
   --#                                    PredicatePair,
   --#                                    State;

   procedure PrintDeclarationTail (File : in SPARK_IO.File_Type);
   --# global in out SPARK_IO.File_Sys;
   --# derives SPARK_IO.File_Sys from *,
   --#                                File;

   procedure OutputDeclarations
     (Heap        : in out Cells.Heap_Record;
      File        : in     SPARK_IO.File_Type;
      Rule_File   : in     SPARK_IO.File_Type;
      Scope       : in     Dictionary.Scopes;
      Write_Rules : in     Boolean;
      EndPosition : in     LexTokenManager.Token_Position);
   --# global in     CommandLineData.Content;
   --#        in     Dictionary.Dict;
   --#        in     LexTokenManager.State;
   --#        in     State;
   --#        in out ErrorHandler.Error_Context;
   --#        in out SPARK_IO.File_Sys;
   --#        in out Statistics.TableUsage;
   --# derives ErrorHandler.Error_Context,
   --#         SPARK_IO.File_Sys          from CommandLineData.Content,
   --#                                         Dictionary.Dict,
   --#                                         EndPosition,
   --#                                         ErrorHandler.Error_Context,
   --#                                         File,
   --#                                         Heap,
   --#                                         LexTokenManager.State,
   --#                                         Rule_File,
   --#                                         Scope,
   --#                                         SPARK_IO.File_Sys,
   --#                                         State,
   --#                                         Write_Rules &
   --#         Heap,
   --#         Statistics.TableUsage      from *,
   --#                                         Dictionary.Dict,
   --#                                         Heap,
   --#                                         LexTokenManager.State,
   --#                                         Scope,
   --#                                         State,
   --#                                         Write_Rules;

private
   type UsedSymbolIterator is record
      It : Cells.Cell;
   end record;

   NullIterator : constant UsedSymbolIterator := UsedSymbolIterator'(It => Cells.Null_Cell);

end Declarations;