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
fdd0c896
Commit
fdd0c896
authored
2 years ago
by
chihebabid
Browse files
Options
Downloads
Patches
Plain Diff
Fix NDFS initialization
parent
6fc23102
No related branches found
Branches containing commit
No related tags found
1 merge request
!6
Feature/ufscc emptiness check
Pipeline
#5032
passed
2 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/algorithm/CNDFS.cpp
+9
-13
9 additions, 13 deletions
src/algorithm/CNDFS.cpp
src/algorithm/CNDFS.h
+7
-8
7 additions, 8 deletions
src/algorithm/CNDFS.h
with
16 additions
and
21 deletions
src/algorithm/CNDFS.cpp
+
9
−
13
View file @
fdd0c896
...
...
@@ -22,6 +22,7 @@ using namespace std;
CNDFS
::
CNDFS
(
ModelCheckBaseMT
*
mcl
,
const
spot
::
twa_graph_ptr
&
af
,
const
uint16_t
&
nbTh
)
:
mMcl
(
mcl
),
mAa
(
af
),
mNbTh
(
nbTh
)
{
getInitialState
();
spawnThreads
();
}
...
...
@@ -43,22 +44,17 @@ void CNDFS::spawnThreads() {
}
void
CNDFS
::
threadHandler
(
void
*
context
)
{
_state
*
state
=
((
CNDFS
*
)
context
)
->
getInitialState
();
((
CNDFS
*
)
context
)
->
dfsBlue
(
state
);
((
CNDFS
*
)
context
)
->
dfsBlue
(((
CNDFS
*
)
context
)
->
mInitStatePtr
);
}
//get initial state of the product automata
_state
*
CNDFS
::
getInitialState
(){
mMutex
.
lock
();
_state
*
initStatePtr
=
static_cast
<
_state
*>
(
malloc
(
sizeof
(
_state
)));
initStatePtr
->
left
=
mMcl
->
getInitialMetaState
();
initStatePtr
->
right
=
mAa
->
get_init_state
();
initStatePtr
->
new_successors
=
static_cast
<
vector
<
pair
<
_state
*
,
int
>>>
(
NULL
);
initStatePtr
->
isAcceptance
=
mAa
->
state_is_accepting
(
mAa
->
get_init_state
());
initStatePtr
->
isConstructed
=
true
;
mMutex
.
unlock
();
// sharedPool.push_back(make_pair(initStatePtr->left,initStatePtr->right));
return
initStatePtr
;
void
CNDFS
::
getInitialState
(){
mInitStatePtr
=
new
_state
;
//static_cast<_state *>(malloc(sizeof(_state)));
mInitStatePtr
->
left
=
mMcl
->
getInitialMetaState
();
mInitStatePtr
->
right
=
mAa
->
get_init_state
();
//mInitStatePtr->new_successors = nullptr;
mInitStatePtr
->
isAcceptance
=
mAa
->
state_is_accepting
(
mAa
->
get_init_state
());
mInitStatePtr
->
isConstructed
=
true
;
}
...
...
This diff is collapsed.
Click to expand it.
src/algorithm/CNDFS.h
+
7
−
8
View file @
fdd0c896
...
...
@@ -20,28 +20,28 @@ struct myState{
LDDState
*
left
;
const
spot
::
twa_graph_state
*
right
;
vector
<
pair
<
struct
myState
*
,
int
>>
new_successors
;
atomic
_
bool
isAcceptance
{
false
};
atomic
_
bool
isConstructed
{
false
};
atomic
<
bool
>
isAcceptance
{
false
};
atomic
<
bool
>
isConstructed
{
false
};
bool
cyan
{
false
};
atomic
_
bool
blue
{
false
};
atomic
_
bool
red
{
false
};
atomic
<
bool
>
blue
{
false
};
atomic
<
bool
>
red
{
false
};
};
typedef
struct
myState
_state
;
// @alias
class
CNDFS
{
private:
static
constexpr
uint8_t
MAX_THREADS
=
64
;
ModelCheckBaseMT
*
mMcl
;
spot
::
twa_graph_ptr
mAa
;
uint16_t
mNbTh
;
atomic
<
uint8_t
>
mIdThread
;
static
void
threadHandler
(
void
*
context
);
std
::
thread
*
mlThread
[
MAX_THREADS
];
mutex
mMutex
;
condition_variable
cv
;
void
spawnThreads
();
_state
*
mInitStatePtr
;
void
getInitialState
();
static
void
threadHandler
(
void
*
context
);
public:
// typedef myState _state;
...
...
@@ -53,7 +53,6 @@ public:
virtual
~
CNDFS
();
void
computeSuccessors
(
_state
*
state
);
void
dfsBlue
(
_state
*
state
);
_state
*
getInitialState
();
void
dfsRed
(
_state
*
state
,
deque
<
_state
*>
mydeque
);
void
WaitForTestCompleted
(
_state
*
state
);
atomic_bool
awaitCondition
(
_state
*
state
,
deque
<
_state
*>
mydeque
);
...
...
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