Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DIVINE
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
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
paradise
mirror
DIVINE
Commits
e5016401
There was an error fetching the commit references. Please try again later.
Commit
e5016401
authored
5 years ago
by
Petr Rockai
Browse files
Options
Downloads
Patches
Plain Diff
MC: Tweak the 'machine' stack for slightly improved flexibility.
parent
e8c4dead
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
divine/mc/machine.hpp
+33
-24
33 additions, 24 deletions
divine/mc/machine.hpp
with
33 additions
and
24 deletions
divine/mc/machine.hpp
+
33
−
24
View file @
e5016401
...
@@ -134,22 +134,6 @@ namespace divine::mc::machine
...
@@ -134,22 +134,6 @@ namespace divine::mc::machine
brick
::
mem
::
RefPool
<
Pool
,
uint8_t
>
_snap_refcnt
;
brick
::
mem
::
RefPool
<
Pool
,
uint8_t
>
_snap_refcnt
;
with_pools
()
:
_snap_refcnt
(
_snap_pool
)
{}
with_pools
()
:
_snap_refcnt
(
_snap_pool
)
{}
void
queue_choices
(
TQ
&
tq
,
Snapshot
snap
,
Origin
origin
,
vm
::
State
state
,
int
take
,
int
total
)
{
for
(
int
i
=
0
;
i
<
total
;
++
i
)
if
(
i
!=
take
)
{
_snap_refcnt
.
get
(
snap
);
tq
.
add
<
Task
::
Choose
>
(
snap
,
origin
,
state
,
i
,
total
);
}
}
int
select_choice
(
TQ
&
tq
,
Snapshot
snap
,
Origin
origin
,
vm
::
State
state
,
int
count
)
{
queue_choices
(
tq
,
snap
,
origin
,
state
,
0
,
count
);
return
0
;
}
};
};
struct
with_counters
struct
with_counters
...
@@ -182,11 +166,35 @@ namespace divine::mc::machine
...
@@ -182,11 +166,35 @@ namespace divine::mc::machine
template
<
typename
solver
,
typename
next
>
template
<
typename
solver
,
typename
next
>
struct
base_
:
TQ
::
Skel
,
with_pools
,
with_counters
,
with_bc
,
with_solver
<
solver
>
,
next
struct
base_
:
TQ
::
Skel
,
with_pools
,
with_counters
,
with_bc
,
with_solver
<
solver
>
,
next
{
{
using
task_choose
=
Task
::
Choose
;
using
task_schedule
=
Task
::
Schedule
;
using
task_edge
=
StateTQ
::
Tasks
::
Edge
;
void
boot
(
TQ
&
)
{}
void
boot
(
TQ
&
)
{}
};
};
template
<
typename
next
>
template
<
typename
next
>
struct
select_random_
:
next
struct
choose_
:
next
{
void
queue_choices
(
TQ
&
tq
,
Snapshot
snap
,
Origin
origin
,
vm
::
State
state
,
int
take
,
int
total
)
{
for
(
int
i
=
0
;
i
<
total
;
++
i
)
if
(
i
!=
take
)
{
this
->
_snap_refcnt
.
get
(
snap
);
tq
.
add
<
typename
next
::
task_choose
>
(
snap
,
origin
,
state
,
i
,
total
);
}
}
int
select_choice
(
TQ
&
tq
,
Snapshot
snap
,
Origin
origin
,
vm
::
State
state
,
int
count
)
{
queue_choices
(
tq
,
snap
,
origin
,
state
,
0
,
count
);
return
0
;
}
};
template
<
typename
next
>
struct
choose_random_
:
next
{
{
std
::
mt19937
rand
;
std
::
mt19937
rand
;
...
@@ -248,7 +256,7 @@ namespace divine::mc::machine
...
@@ -248,7 +256,7 @@ namespace divine::mc::machine
lbl
.
accepting
=
this
->
context
().
flags_any
(
_VM_CF_Accepting
);
lbl
.
accepting
=
this
->
context
().
flags_any
(
_VM_CF_Accepting
);
lbl
.
error
=
this
->
context
().
flags_any
(
_VM_CF_Error
);
lbl
.
error
=
this
->
context
().
flags_any
(
_VM_CF_Error
);
auto
[
state
,
isnew
]
=
this
->
store
();
auto
[
state
,
isnew
]
=
this
->
store
();
tq
.
add
<
StateTQ
::
Skel
::
E
dge
>
(
State
(
origin
.
snap
),
state
,
lbl
,
isnew
);
tq
.
add
<
typename
next
::
task_e
dge
>
(
State
(
origin
.
snap
),
state
,
lbl
,
isnew
);
}
}
else
if
(
this
->
loop_closed
(
origin
)
)
else
if
(
this
->
loop_closed
(
origin
)
)
{
{
...
@@ -299,7 +307,7 @@ namespace divine::mc::machine
...
@@ -299,7 +307,7 @@ namespace divine::mc::machine
next
::
boot
(
tq
);
next
::
boot
(
tq
);
if
(
vm
::
setup
::
postboot_check
(
this
->
context
()
)
)
if
(
vm
::
setup
::
postboot_check
(
this
->
context
()
)
)
return
tq
.
add
<
Task
::
S
chedule
>
(
this
->
store
().
first
),
true
;
return
tq
.
add
<
typename
next
::
task_s
chedule
>
(
this
->
store
().
first
),
true
;
else
else
return
false
;
return
false
;
}
}
...
@@ -428,18 +436,19 @@ namespace divine::mc::machine
...
@@ -428,18 +436,19 @@ namespace divine::mc::machine
using
with_context
=
brq
::
module
<
with_context_
,
ctx
>
;
using
with_context
=
brq
::
module
<
with_context_
,
ctx
>
;
using
compute
=
brq
::
module
<
compute_
>
;
using
compute
=
brq
::
module
<
compute_
>
;
using
select_random
=
brq
::
module
<
select_random_
>
;
using
choose
=
brq
::
module
<
choose_
>
;
using
choose_random
=
brq
::
module
<
choose_random_
>
;
using
tree_store
=
brq
::
module
<
tree_store_
>
;
using
tree_store
=
brq
::
module
<
tree_store_
>
;
using
graph_store
=
brq
::
module
<
graph_store_
>
;
using
graph_store
=
brq
::
module
<
graph_store_
>
;
using
dispatch
=
brq
::
module
<
dispatch_
>
;
using
dispatch
=
brq
::
module
<
dispatch_
>
;
template
<
typename
solver
>
template
<
typename
solver
>
using
tree
=
brq
::
compose_stack
<
dispatch
,
compute
,
tree_store
,
using
tree
=
brq
::
compose_stack
<
dispatch
,
compute
,
tree_store
,
choose
,
with_context
<
MC
ontext
>
,
base
<
solver
>
>
;
with_context
<
c
ontext
>
,
base
<
solver
>
>
;
template
<
typename
solver
>
template
<
typename
solver
>
using
graph
=
brq
::
compose_stack
<
dispatch
,
compute
,
graph_store
,
with_context
<
MContext
>
,
using
graph
=
brq
::
compose_stack
<
dispatch
,
compute
,
graph_store
,
choose
,
base
<
solver
>
>
;
with_context
<
context
>
,
base
<
solver
>
>
;
}
}
namespace
divine
::
mc
namespace
divine
::
mc
...
...
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