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
3cc7b343
Commit
3cc7b343
authored
5 years ago
by
Hiba Ouni
Browse files
Options
Downloads
Patches
Plain Diff
src
parent
a8d3c044
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/SogKripke.cpp
+73
-0
73 additions, 0 deletions
src/SogKripke.cpp
src/SogKripke.h
+25
-0
25 additions, 0 deletions
src/SogKripke.h
with
98 additions
and
0 deletions
src/SogKripke.cpp
0 → 100644
+
73
−
0
View file @
3cc7b343
#include
<spot/twaalgos/dot.hh>
#include
<spot/twaalgos/hoa.hh>
#include
<spot/twa/twa.hh>
#include
<spot/twa/bdddict.hh>
#include
"SpotSogIterator.h"
#include
"SpotSogState.h"
#include
"SogKripke.h"
#include
<map>
using
namespace
spot
;
SogKripke
::
SogKripke
(
const
bdd_dict_ptr
&
dict_ptr
,
LDDGraph
*
sog
)
:
twa
(
dict_ptr
),
m_sog
(
sog
)
{
SpotSogIterator
::
m_graph
=
sog
;
SpotSogIterator
::
m_dict_ptr
=&
dict_ptr
;
/*spot::bdd_dict *p=dict_ptr.get();
cout<<"Taille du dictionnaire :"<<p->var_map.size()<<endl;
map<spot::formula,int>::iterator i=(p->var_map).begin();
while (i!=(p->var_map).end()) {
cout<<" test :"<<(*i).first.ap_name()<<endl;
std::ostringstream stream;
stream << (*i).first;
std::string str = stream.str();
cout<<" formule 1: "<<str<<endl;
cout<<" formule 2: "<<str<<endl;
i++;
}*/
//spot::bdd_format_formula(dict_ptr,"test");
//map<bdd,spot::ltl::formula>.iterator it=p->vf_map.begin();
}
state
*
SogKripke
::
get_init_state
()
const
{
//cout<<"Initial state given...\n";
return
new
SpotSogState
(
m_sog
->
getInitialState
());
//new SpotSogState();
}
// Allows to print state label representing its id
std
::
string
SogKripke
::
format_state
(
const
spot
::
state
*
s
)
const
{
auto
ss
=
static_cast
<
const
SpotSogState
*>
(
s
);
std
::
ostringstream
out
;
out
<<
"( "
<<
ss
->
getLDDState
()
->
getLDDValue
()
<<
")"
;
return
out
.
str
();
}
SpotSogIterator
*
SogKripke
::
succ_iter
(
const
spot
::
state
*
s
)
const
{
auto
ss
=
static_cast
<
const
SpotSogState
*>
(
s
);
bdd
b
=
bddfalse
;
return
new
SpotSogIterator
(
ss
->
getLDDState
());
//,b);//s state_condition(ss));
}
MDD
state_condition
(
const
spot
::
state
*
s
)
const
override
{
auto
ss
=
static_cast
<
const
SpotSogState
*>
(
s
);
MDD
res
=
lddmc_true
;
std
::
map
<
int
,
int
>::
const_iterator
it
;
for
(
it
=
place_prop
.
begin
();
it
!=
place_prop
.
end
();
++
it
)
if
(
m_sog
->
is_marked
(
it
->
first
,
m
))
return
res
;
}
SogKripke
::~
SogKripke
()
{
//dtor
}
This diff is collapsed.
Click to expand it.
src/SogKripke.h
0 → 100644
+
25
−
0
View file @
3cc7b343
#ifndef SOGKRIPKE_H_INCLUDED
#define SOGKRIPKE_H_INCLUDED
class
SogKripke
:
public
spot
::
kripke
{
public:
SogKripke
(
const
spot
::
bdd_dict_ptr
&
dict_ptr
,
LDDGraph
*
sog
);
virtual
~
SogKripke
();
spot
::
state
*
get_init_state
()
const
;
SpotSogIterator
*
succ_iter
(
const
spot
::
state
*
s
)
const
override
;
std
::
string
format_state
(
const
spot
::
state
*
s
)
const
override
;
MDD
state_condition
(
const
spot
::
state
*
s
)
const
override
;
protected:
private:
std
::
map
<
int
,
int
>
place_prop
;
LDDGraph
*
m_sog
;
};
#endif // SOGKRIPKE_H_INCLUDED
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