Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Alnos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Michele Volpato
Alnos
Commits
e83cec37
Commit
e83cec37
authored
Jan 08, 2016
by
Michele
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added figure 2.5 from thesis
parent
082cdd45
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
105 additions
and
1 deletion
+105
-1
CHANGELOG.md
CHANGELOG.md
+1
-0
README.md
README.md
+1
-1
examples/figure2-5_thesis.py
examples/figure2-5_thesis.py
+103
-0
No files found.
CHANGELOG.md
View file @
e83cec37
...
...
@@ -9,6 +9,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Changed
-
License
-
Name: new name is Alnos
## [v0.2.0] - 2015-10-27
### Added
...
...
README.md
View file @
e83cec37
## Synopsis
The active-learning-nondeterministic-systems
is an implementation of an
**Alnos**
is an implementation of an
adaptation of
[
L*
](
http://www.cs.berkeley.edu/~dawnsong/teaching/s10/papers/angluin87.pdf
)
to
nondeterministic systems. The code is based on these scientific papers:
...
...
examples/figure2-5_thesis.py
0 → 100644
View file @
e83cec37
# Copyright (c) 2015 Michele Volpato
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# This file is used to learn the IOTS depicted in Figure 2.5 of my PhD thesis.
import
random
seed
=
output
=
random
.
sample
(
range
(
99999999
),
1
)[
0
]
print
(
seed
)
random
.
seed
(
81077353
)
# 81077353
import
os
,
inspect
,
sys
# Include project dir in path
currentdir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
inspect
.
getfile
(
inspect
.
currentframe
())))
parentdir
=
os
.
path
.
dirname
(
currentdir
)
sys
.
path
.
append
(
parentdir
)
from
learning.learning
import
LearningAlgorithm
from
teachers.ltsteachers
import
InputOutputTeacher
from
systems.implementations
import
InputOutputLTS
from
teachers.ltsoracles
import
InputOutputPowerOracle
import
logging
import
helpers.bisimulation
as
bi
from
testing.randomtesting
import
RandomTester
from
systems.iopurpose
import
InputPurpose
,
OutputPurpose
import
helpers.graphhelper
as
gh
logging
.
basicConfig
(
level
=
logging
.
DEBUG
)
logger
=
logging
.
getLogger
(
__name__
)
inputs
=
set
([
'b'
])
outputs
=
set
([
't'
,
'c'
])
quiescence
=
'd'
I1
=
InputOutputLTS
(
8
,
inputs
,
outputs
,
quiescence
)
I1
.
addTransition
(
0
,
'b'
,
1
)
I1
.
addTransition
(
0
,
'b'
,
2
)
I1
.
addTransition
(
1
,
't'
,
3
)
I1
.
addTransition
(
1
,
'c'
,
3
)
I1
.
addTransition
(
1
,
'b'
,
6
)
I1
.
addTransition
(
2
,
'b'
,
4
)
I1
.
addTransition
(
3
,
't'
,
0
)
I1
.
addTransition
(
3
,
'c'
,
0
)
I1
.
addTransition
(
3
,
'b'
,
6
)
I1
.
addTransition
(
4
,
'c'
,
5
)
I1
.
addTransition
(
4
,
'b'
,
6
)
I1
.
addTransition
(
5
,
'b'
,
6
)
I1
.
addTransition
(
5
,
't'
,
0
)
I1
.
addTransition
(
5
,
'c'
,
0
)
# Chaos
I1
.
addTransition
(
6
,
'b'
,
6
)
I1
.
addTransition
(
6
,
't'
,
6
)
I1
.
addTransition
(
6
,
'c'
,
6
)
I1
.
addTransition
(
6
,
'd'
,
7
)
I1
.
addTransition
(
7
,
'b'
,
6
)
I1
.
makeInputEnabled
()
T1
=
InputOutputTeacher
(
I1
)
O1
=
InputOutputPowerOracle
(
I1
)
outputExpert
=
OutputPurpose
(
set
([
't'
,
'c'
,
quiescence
]))
inputExpert
=
InputPurpose
(
set
([
'b'
]))
tester
=
RandomTester
(
T1
,
10000
,
50
)
currentdir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
inspect
.
getfile
(
inspect
.
currentframe
())))
path
=
os
.
path
.
join
(
currentdir
,
"dotFiles"
)
gh
.
createDOTFile
(
I1
,
path
+
"figure2-5"
,
"pdf"
)
print
(
"Starting learning..."
)
# change printPath=None to printPath=path for dot files
L2
=
LearningAlgorithm
(
T1
,
O1
,
printPath
=
path
,
maxLoops
=
4
,
tablePreciseness
=
10000
,
logger
=
logger
,
tester
=
tester
,
outputPurpose
=
outputExpert
,
inputPurpose
=
inputExpert
)
minus
,
plus
=
L2
.
run
()
print
(
"Models learned. Check language equivalence..."
)
print
(
"hMinus bisimilar to target: "
+
str
(
bi
.
bisimilar
(
I1
,
minus
)))
print
(
"hPlus bisimilar to target: "
+
str
(
bi
.
bisimilar
(
I1
,
plus
)))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment