Skip to content

Commit 76d543b

Browse files
author
kroening
committed
further goto_modelt APIs
git-svn-id: svn+ssh://svn.cprover.org/srv/svn/cbmc/trunk@3867 6afb6bc1-c8e4-404c-8f48-9ae832c5b171
1 parent 2cd95d0 commit 76d543b

8 files changed

+146
-11
lines changed

src/goto-programs/goto_convert_functions.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,27 @@ Function: goto_convert
289289
290290
\*******************************************************************/
291291

292+
void goto_convert(
293+
symbol_tablet &symbol_table,
294+
goto_modelt &goto_model,
295+
message_handlert &message_handler)
296+
{
297+
goto_convert(symbol_table, goto_model.goto_functions, message_handler);
298+
goto_model.symbol_table.swap(symbol_table);
299+
}
300+
301+
/*******************************************************************\
302+
303+
Function: goto_convert
304+
305+
Inputs:
306+
307+
Outputs:
308+
309+
Purpose:
310+
311+
\*******************************************************************/
312+
292313
void goto_convert(
293314
symbol_tablet &symbol_table,
294315
goto_functionst &functions,

src/goto-programs/goto_convert_functions.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Date: June 2003
1111
#ifndef CPROVER_GOTO_CONVERT_FUNCTIONS_H
1212
#define CPROVER_GOTO_CONVERT_FUNCTIONS_H
1313

14-
#include "goto_functions.h"
14+
#include "goto_model.h"
1515
#include "goto_convert_class.h"
1616

1717
// convert it all!
@@ -20,6 +20,12 @@ void goto_convert(
2020
goto_functionst &functions,
2121
message_handlert &message_handler);
2222

23+
// convert it all!
24+
void goto_convert(
25+
symbol_tablet &symbol_table,
26+
goto_modelt &dest,
27+
message_handlert &message_handler);
28+
2329
// just convert a specific function
2430
void goto_convert(
2531
const irep_idt &identifier,

src/goto-programs/link_to_library.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,28 @@ Function: link_to_library
2424
2525
\*******************************************************************/
2626

27+
void link_to_library(
28+
goto_modelt &goto_model,
29+
message_handlert &message_handler)
30+
{
31+
link_to_library(
32+
goto_model.symbol_table,
33+
goto_model.goto_functions,
34+
message_handler);
35+
}
36+
37+
/*******************************************************************\
38+
39+
Function: link_to_library
40+
41+
Inputs:
42+
43+
Outputs:
44+
45+
Purpose:
46+
47+
\*******************************************************************/
48+
2749
void link_to_library(
2850
symbol_tablet &symbol_table,
2951
goto_functionst &goto_functions,

src/goto-programs/link_to_library.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@ Author: Daniel Kroening, [email protected]
1111

1212
#include <util/message.h>
1313

14-
#include "goto_functions.h"
14+
#include "goto_model.h"
1515

1616
void link_to_library(
17-
symbol_tablet &symbol_table,
18-
goto_functionst &goto_functions,
19-
message_handlert &message_handler);
17+
symbol_tablet &,
18+
goto_functionst &,
19+
message_handlert &);
20+
21+
void link_to_library(
22+
goto_modelt &,
23+
message_handlert &);
2024

2125
#endif

src/goto-programs/loop_ids.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,25 @@ Function: show_loop_ids
2626
2727
\*******************************************************************/
2828

29+
void show_loop_ids(
30+
ui_message_handlert::uit ui,
31+
const goto_modelt &goto_model)
32+
{
33+
show_loop_ids(ui, goto_model.goto_functions);
34+
}
35+
36+
/*******************************************************************\
37+
38+
Function: show_loop_ids
39+
40+
Inputs:
41+
42+
Outputs:
43+
44+
Purpose:
45+
46+
\*******************************************************************/
47+
2948
void show_loop_ids(
3049
ui_message_handlert::uit ui,
3150
const goto_programt &goto_program)

src/goto-programs/loop_ids.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@ Author: Daniel Kroening, [email protected]
1111

1212
#include <util/ui_message.h>
1313

14-
#include "goto_functions.h"
14+
#include "goto_model.h"
1515

1616
void show_loop_ids(
17-
ui_message_handlert::uit ui,
18-
const goto_functionst &goto_functions);
17+
ui_message_handlert::uit,
18+
const goto_modelt &);
1919

2020
void show_loop_ids(
21-
ui_message_handlert::uit ui,
22-
const goto_programt &goto_program);
21+
ui_message_handlert::uit,
22+
const goto_functionst &);
23+
24+
void show_loop_ids(
25+
ui_message_handlert::uit,
26+
const goto_programt &);
2327

2428
#endif

src/goto-programs/set_properties.cpp

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,23 @@ Function: label_properties
5858
5959
\*******************************************************************/
6060

61+
void label_properties(goto_modelt &goto_model)
62+
{
63+
label_properties(goto_model.goto_functions);
64+
}
65+
66+
/*******************************************************************\
67+
68+
Function: label_properties
69+
70+
Inputs:
71+
72+
Outputs:
73+
74+
Purpose:
75+
76+
\*******************************************************************/
77+
6178
void label_properties(
6279
goto_programt &goto_program,
6380
std::map<irep_idt, unsigned> &property_counters)
@@ -112,6 +129,25 @@ Function: set_properties
112129
113130
\*******************************************************************/
114131

132+
void set_properties(
133+
goto_modelt &goto_model,
134+
const std::list<std::string> &properties)
135+
{
136+
set_properties(goto_model.goto_functions, properties);
137+
}
138+
139+
/*******************************************************************\
140+
141+
Function: set_properties
142+
143+
Inputs:
144+
145+
Outputs:
146+
147+
Purpose:
148+
149+
\*******************************************************************/
150+
115151
void set_properties(
116152
goto_functionst &goto_functions,
117153
const std::list<std::string> &properties)
@@ -171,6 +207,23 @@ Function: make_assertions_false
171207
172208
\*******************************************************************/
173209

210+
void make_assertions_false(goto_modelt &goto_model)
211+
{
212+
make_assertions_false(goto_model.goto_functions);
213+
}
214+
215+
/*******************************************************************\
216+
217+
Function: make_assertions_false
218+
219+
Inputs:
220+
221+
Outputs:
222+
223+
Purpose:
224+
225+
\*******************************************************************/
226+
174227
void make_assertions_false(
175228
goto_functionst &goto_functions)
176229
{

src/goto-programs/set_properties.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,21 @@ Author: Daniel Kroening, [email protected]
99
#ifndef CPROVER_GOTO_PROGRAMS_SET_PROPERTIES_H
1010
#define CPROVER_GOTO_PROGRAMS_SET_PROPERTIES_H
1111

12-
#include <goto-programs/goto_functions.h>
12+
#include "goto_model.h"
1313

1414
void set_properties(
1515
goto_functionst &goto_functions,
1616
const std::list<std::string> &properties);
1717

18+
void set_properties(
19+
goto_modelt &goto_model,
20+
const std::list<std::string> &properties);
21+
1822
void make_assertions_false(goto_functionst &);
23+
void make_assertions_false(goto_modelt &);
1924

2025
void label_properties(goto_functionst &);
2126
void label_properties(goto_programt &);
27+
void label_properties(goto_modelt &);
2228

2329
#endif

0 commit comments

Comments
 (0)