Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Franck Pommereau
/
snakes
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Franck Pommereau
2013-12-11 17:37:37 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ab68f8de92ae8f11f866bd241e7f4fe32899e0f8
ab68f8de
1 parent
5bc14b1b
updated doc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletions
snakes/nets.py
snakes/nets.py
View file @
ab68f8d
...
...
@@ -1507,11 +1507,22 @@ class Inhibitor (Test) :
"""Like `Test`, it works by encapsulating another annotation.
Additionally, a condition may be given which allows to select
the forbidden tokens more precisely. This is generally better
to make this selection at this
e
level rather that at the level
to make this selection at this level rather that at the level
of a transition guard: indeed, in the latter case, we may
build many modes and reject most of them because of the guard;
while in the former case, we will not build these modes at
all.
For instance:
* `Inhibitor(Value(3))` ensures that there is no token whose
value is `3` in the place when the transition is fired
* `Inhibitor(Variable('x'))` ensures that there is no token
at all in the place
* `Inhibitor(Variable('x'), Expression('x<3'))` ensures that
there is no token whose value is less that `3`
* `Inhibitor(MultiArc([Variable('x'), Variable('y')]),
Expression('x>y'))` ensures that there is no pair of
tokens such that one is greater that the other
"""
self
.
_annotation
=
annotation
if
hasattr
(
annotation
,
"globals"
)
:
...
...
@@ -1553,6 +1564,7 @@ class Inhibitor (Test) :
return
Tree
(
self
.
__pnmltag__
,
None
,
Tree
(
"annotation"
,
None
,
Tree
.
from_obj
(
self
.
_annotation
)),
Tree
(
"condition"
,
None
,
Tree
.
from_obj
(
self
.
_condition
)))
# apidoc skip
@classmethod
def
__pnmlload__
(
cls
,
tree
)
:
"""Create a `Inhibitor` from a PNML tree
...
...
Please
register
or
login
to post a comment