Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
async-mpst-gen-choice
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
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Felix Stutz
async-mpst-gen-choice
Merge requests
!1
Subset projection
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Subset projection
subset_projection
into
master
Overview
0
Commits
43
Pipelines
0
Changes
1000+
Merged
Subset projection
Felix Stutz
requested to merge
subset_projection
into
master
May 31, 2023
Overview
0
Commits
43
Pipelines
0
Changes
1000
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
0c049e88
43 commits,
May 31, 2023
1000+ files
+
845
−
543
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
1000+
Some changes are not shown.
For a faster browsing experience, only
1000 of 1000+
files are shown. Download one of the files below to see all changes.
Plain diff
Patches
datatypes/AvailabilitySet.py
→
datatypes/
classical_projection/
AvailabilitySet.py
+
6
−
10
View file @ 0c049e88
Edit in single-file editor
Open in Web IDE
Show full file
from
datatypes.GlobalType
import
*
from
datatypes.LocalType
import
*
from
datatypes.GlobTypeKinds
import
*
from
datatypes.GlobalTypeParsed
import
*
from
datatypes.classical_projection.LocalType
import
*
import
os
class
AvailabilitySet
:
def
__init__
(
self
,
global_type
,
process
,
blocked_procs
,
handled_vars
,
rec_var_map
,
vars_empty
):
avail_check
=
os
.
getenv
(
'
AVAIL_CHECK
'
)
self
.
isoption
=
type
(
global_type
)
is
tuple
self
.
option
=
global_type
self
.
global_type
=
global_type
@@ -29,9 +27,9 @@ class AvailabilitySet:
m
.
receiver
!=
self
.
option
[
0
].
receiver
,
avail_msgs_option
))
return
avail_msgs_option_possible
elif
self
.
global_type
.
kind
==
GlobTypeKinds
.
NULLTYPE
:
elif
self
.
global_type
.
kind
==
Glob
al
TypeKinds
.
NULLTYPE
:
return
set
()
elif
self
.
global_type
.
kind
==
GlobTypeKinds
.
CHOICE
:
elif
self
.
global_type
.
kind
==
Glob
al
TypeKinds
.
CHOICE
:
# 1) Process is sender
if
self
.
global_type
.
options
[
0
][
0
].
sender
==
self
.
process
:
avail_set
=
set
()
@@ -60,7 +58,6 @@ class AvailabilitySet:
snd_avail_msgs
=
set
()
for
option
in
list_not_part_of_msg_exc
:
# not part of msg_exc so we omit to project to an empty one here
# TODO: compute avail_msgs here instead of projections
proj_cont
=
option
[
1
].
project_onto
(
self
.
process
,
self
.
vars_empty
,
self
.
rec_var_map
)
# check whether the continuation is
is_rec_for_one
=
False
@@ -71,8 +68,7 @@ class AvailabilitySet:
if
not
is_rec_for_one
:
snd_avail_msgs
.
update
(
proj_cont
.
avail
)
return
fst_avail_msgs
.
union
(
snd_avail_msgs
)
elif
self
.
global_type
.
kind
==
GlobTypeKinds
.
RECURSION
:
# TODO: compute avail_msgs here instead of projections
elif
self
.
global_type
.
kind
==
GlobalTypeKinds
.
RECURSION
:
proj_cont
=
self
.
global_type
.
continuation
.
project_onto
(
self
.
process
,
{
self
.
global_type
.
bound_variable
}.
union
(
self
.
vars_empty
),
self
.
rec_var_map
)
is_bound_variable_itself
=
proj_cont
.
kind
==
LocalTypeKinds
.
REC_VAR
and
\
proj_cont
.
ref_variable
==
self
.
global_type
.
bound_variable
@@ -82,7 +78,7 @@ class AvailabilitySet:
return
avail_msgs
else
:
return
set
()
elif
self
.
global_type
.
kind
==
GlobTypeKinds
.
REC_VAR
:
elif
self
.
global_type
.
kind
==
Glob
al
TypeKinds
.
REC_VAR
:
avail_msgs
=
self
.
rec_var_map
[
self
.
global_type
.
ref_variable
].
avail_msgs
(
self
.
process
,
{
self
.
process
},
{
self
.
global_type
.
ref_variable
},
self
.
rec_var_map
)
return
avail_msgs
else
:
Loading