Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mc-sog
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PMC-SOG
mc-sog
Commits
685c9f26
Commit
685c9f26
authored
2 years ago
by
Ghofrane Amaimi
Browse files
Options
Downloads
Patches
Plain Diff
trying to detect the right succ of the Initial state of BA
parent
b001c346
No related branches found
Branches containing commit
No related tags found
1 merge request
!6
Feature/ufscc emptiness check
Pipeline
#4999
passed
2 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/algorithm/CNDFS.cpp
+42
-12
42 additions, 12 deletions
src/algorithm/CNDFS.cpp
with
42 additions
and
12 deletions
src/algorithm/CNDFS.cpp
+
42
−
12
View file @
685c9f26
...
@@ -8,18 +8,27 @@
...
@@ -8,18 +8,27 @@
#include
<spot/twa/twagraph.hh>
#include
<spot/twa/twagraph.hh>
#include
<thread>
#include
<thread>
#include
<vector>
#include
<vector>
#include
<spot/twa/twaproduct.hh>
#include
<spot/twa/twa.hh>
#include
<spot/twa/twa.hh>
#include
<bddx.h>
using
namespace
std
;
using
namespace
std
;
struct
new_state
{
struct
start_state
{
LDDState
*
left
;;
LDDState
*
left
;
spot
::
state
*
right
;
const
spot
::
twa_graph_state
*
right
;
};
struct
end_state
{
LDDState
*
left
;
const
spot
::
twa_succ_iterator
*
right
;
};
};
list
<
spot
::
formula
>
transitionNames
;
struct
graphEdge
{
start_state
ss
;
end_state
es
;
int
weight
;
};
list
<
spot
::
formula
>
transitionNames
;
vector
<
bdd
>
temp
;
CNDFS
::
CNDFS
(
ModelCheckBaseMT
*
mcl
,
const
spot
::
twa_graph_ptr
&
af
,
const
uint16_t
&
nbTh
)
:
mMcl
(
mcl
),
mAa
(
af
),
CNDFS
::
CNDFS
(
ModelCheckBaseMT
*
mcl
,
const
spot
::
twa_graph_ptr
&
af
,
const
uint16_t
&
nbTh
)
:
mMcl
(
mcl
),
mAa
(
af
),
mNbTh
(
nbTh
)
{
mNbTh
(
nbTh
)
{
spawnThreads
();
spawnThreads
();
...
@@ -31,7 +40,6 @@ CNDFS::~CNDFS() {
...
@@ -31,7 +40,6 @@ CNDFS::~CNDFS() {
delete
mlThread
[
i
];
delete
mlThread
[
i
];
}
}
}
}
/*
/*
* @Brief Create threads
* @Brief Create threads
*/
*/
...
@@ -66,21 +74,43 @@ void CNDFS::computeProduct() {
...
@@ -66,21 +74,43 @@ void CNDFS::computeProduct() {
}
}
for
(
int
i
=
0
;
i
<
mMcl
->
getInitialMetaState
()
->
Successors
.
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
mMcl
->
getInitialMetaState
()
->
Successors
.
size
();
i
++
)
{
cout
<<
"------"
<<
i
<<
" SOG's successor ------"
<<
endl
;
cout
<<
"------"
<<
" SOG's successor "
<<
i
<<
" ------"
<<
endl
;
int
transition
=
mMcl
->
getInitialMetaState
()
->
Successors
.
at
(
int
transition
=
mMcl
->
getInitialMetaState
()
->
Successors
.
at
(
i
).
second
;
// je récupère le numéro de la première transition
i
).
second
;
// je récupère le numéro de la première transition
auto
name
=
string
(
mMcl
->
getTransition
(
transition
));
// récuprer le nom de la transition
auto
name
=
string
(
mMcl
->
getTransition
(
transition
));
// récuprer le nom de la transition
auto
f
=
spot
::
formula
::
ap
(
name
);
// récuperer la proposition atomique qui correspond à la transi
i
tion
auto
f
=
spot
::
formula
::
ap
(
name
);
// récuperer la proposition atomique qui correspond à la transition
transitionNames
.
push_back
(
f
);
// push state'S AP to edge'S AP
transitionNames
.
push_back
(
f
);
// push state'S AP to edge'S AP
auto
p
=
mAa
->
get_dict
();
//avoir le dictionnaire bdd,proposition atomique
auto
p
=
mAa
->
get_dict
();
//avoir le dictionnaire bdd,proposition atomique
spot
::
twa_succ_iterator
*
ii
=
mAa
->
succ_iter
(
mAa
->
get_init_state
());
if
(
ii
->
first
())
do
{
temp
.
push_back
(
ii
->
cond
());
}
while
(
ii
->
next
());
mAa
->
release_iter
(
ii
);
// cout << temp.size() << endl; // 22
// cout << p->bdd_map.size() << endl; //62
for
(
auto
v
:
p
->
var_map
)
{
cout
<<
v
.
first
<<
"-----"
<<
v
.
second
<<
endl
;
}
for
(
auto
it
=
transitionNames
.
begin
();
it
!=
transitionNames
.
end
();
++
it
)
{
for
(
auto
it
=
transitionNames
.
begin
();
it
!=
transitionNames
.
end
();
++
it
)
{
if
(
p
->
var_map
.
find
(
*
it
)
!=
p
->
var_map
.
end
())
{
// Chercher la transition
if
(
p
->
var_map
.
find
(
*
it
)
!=
p
->
var_map
.
end
())
{
// Chercher la transition
bdd
result
=
bdd_ithvar
((
p
->
var_map
.
find
(
*
it
))
->
second
);
// Pblm: here I want to detect the right successor of initial state BA
cout
<<
"dbb result "
<<
result
<<
endl
;
//new starting state
struct
start_state
ns
=
{
mMcl
->
getInitialMetaState
(),
mAa
->
get_init_state
()};
//new terminal state
struct
end_state
nd
=
{
mMcl
->
getInitialMetaState
()
->
Successors
.
at
(
i
).
first
,
ii
};
struct
graphEdge
ge
=
{
ns
,
nd
,
1
};
cout
<<
*
it
<<
" is a common transaction!"
<<
endl
;
// p->var_map.find ( f )->second => donne la bdd
cout
<<
*
it
<<
" is a common transaction!"
<<
endl
;
// p->var_map.find ( f )->second => donne la bdd
}
else
cout
<<
*
it
<<
" isn't a common transaction"
<<
endl
;
}
else
cout
<<
*
it
<<
" isn't a common transaction"
<<
endl
;
}
}
transitionNames
.
pop_back
();
}
}
}
}
spot
::
bdd_dict_ptr
*
CNDFS
::
m_dict_ptr
;
spot
::
bdd_dict_ptr
*
CNDFS
::
m_dict_ptr
;
////
////
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment