Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Spot
divine-ltsmin-deb
Commits
99cbaaa1
Commit
99cbaaa1
authored
Aug 18, 2010
by
Elwin Pater
Committed by
Michael Weber
Nov 05, 2010
Browse files
Added necessary disabling set
parent
95eb4c7f
Changes
2
Hide whitespace changes
Inline
Side-by-side
tools/dvecompile.cpp
View file @
99cbaaa1
...
...
@@ -2309,6 +2309,40 @@ void dve_compiler::gen_transition_info()
line
(
buf
);
block_end
();
line
();
////////////////////////////////////////////////
// EXPORT NECESSARY DISABLING SETS FOR GUARDS //
////////////////////////////////////////////////
// guard nes matrix (#guards x #transitions)
sprintf
(
buf
,
"int guard_nds[%zu][%zu] = "
,
guard
.
size
(),
transitions
.
size
());
line
(
buf
);
block_begin
();
for
(
size_int_t
i
=
0
;
i
<
guard
.
size
();
i
++
)
{
append
(
"{"
);
for
(
size_int_t
j
=
0
;
j
<
transitions
.
size
();
j
++
)
{
if
(
j
!=
0
)
append
(
", "
);
append
(
is_guard_nds
(
guard
[
i
],
transitions
[
j
])
?
"1"
:
"0"
);
}
if
(
i
==
guard
.
size
()
-
1
)
line
(
"}"
);
else
line
(
"},"
);
}
block_end
();
line
(
";"
);
line
();
// guard nes function
line
(
"extern
\"
C
\"
const int* get_guard_nds_matrix(int g) "
);
block_begin
();
sprintf
(
buf
,
"if (g>=0 && g < %zu) return guard_nds[g];"
,
guard
.
size
());
line
(
buf
);
sprintf
(
buf
,
"return NULL;"
);
line
(
buf
);
block_end
();
line
();
}
bool
dve_compiler
::
is_guard_nes
(
guard
&
g
,
ext_transition_t
&
t
)
{
...
...
@@ -2334,6 +2368,31 @@ bool dve_compiler::is_guard_nes( guard& g, ext_transition_t& t ) {
return
true
;
}
bool
dve_compiler
::
is_guard_nds
(
guard
&
g
,
ext_transition_t
&
t
)
{
switch
(
g
.
type
)
{
case
GUARD_PC
:
if
(
g
.
pc
.
gid
==
t
.
first
->
get_process_gid
())
return
(
g
.
pc
.
lid
==
t
.
first
->
get_state1_lid
()
&&
g
.
pc
.
lid
!=
t
.
first
->
get_state2_lid
());
if
(
t
.
synchronized
&&
g
.
pc
.
gid
==
t
.
second
->
get_process_gid
())
return
(
g
.
pc
.
lid
==
t
.
second
->
get_state1_lid
()
&&
g
.
pc
.
lid
!=
t
.
second
->
get_state2_lid
());
return
false
;
case
GUARD_CHAN
:
if
(
!
t
.
synchronized
&&
g
.
chan
.
chan
==
t
.
first
->
get_channel_gid
())
{
if
(
t
.
first
->
get_sync_mode
()
==
SYNC_EXCLAIM_BUFFER
||
t
.
first
->
get_sync_mode
()
==
SYNC_ASK_BUFFER
)
{
return
g
.
chan
.
sync_mode
==
t
.
first
->
get_sync_mode
();
}
}
return
false
;
/*
case GUARD_COMMITED_FIRST:
return ( dynamic_cast<dve_process_t*>(get_process(t.first->get_process_gid()))->get_commited(t.first->get_state1_lid()) &&
!dynamic_cast<dve_process_t*>(get_process(t.first->get_process_gid()))->get_commited(t.first->get_state2_lid()));
*/
}
return
true
;
}
bool
dve_compiler
::
may_be_coenabled
(
guard
&
ga
,
guard
&
gb
)
{
// if type different, return default
if
(
ga
.
type
==
gb
.
type
||
ga
.
type
==
GUARD_COMMITED_FIRST
)
{
...
...
tools/dvecompile.h
View file @
99cbaaa1
...
...
@@ -233,6 +233,7 @@ struct dve_compiler: public dve_explicit_system_t
bool
get_const_varname
(
dve_expression_t
&
expr
,
string
&
var
);
bool
get_const_expression
(
dve_expression_t
&
expr
,
int
&
value
);
bool
is_guard_nes
(
guard
&
g
,
ext_transition_t
&
t
);
bool
is_guard_nds
(
guard
&
g
,
ext_transition_t
&
t
);
bool
may_be_coenabled
(
guard
&
ga
,
guard
&
gb
);
void
extract_predicates
(
std
::
vector
<
simple_predicate
>&
p
,
dve_expression_t
&
e
);
bool
is_conflict_predicate
(
simple_predicate
&
p1
,
simple_predicate
p2
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment