Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DOML Model Checker
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
Model registry
Operate
Environments
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
PIACERE
public
The Platform
DOML Model Checker
Commits
0c69ddd7
Commit
0c69ddd7
authored
2 years ago
by
Andrea Franchini
Browse files
Options
Downloads
Patches
Plain Diff
Fix typos in synthesis.py
parent
c778870d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
mc_openapi/__main__.py
+3
-3
3 additions, 3 deletions
mc_openapi/__main__.py
mc_openapi/doml_mc/synthesis/synthesis.py
+6
-6
6 additions, 6 deletions
mc_openapi/doml_mc/synthesis/synthesis.py
with
9 additions
and
9 deletions
mc_openapi/__main__.py
+
3
−
3
View file @
0c69ddd7
...
...
@@ -69,7 +69,7 @@ else:
if
args
.
synth
:
#
try:
try
:
synth
=
Synthesis
(
dmc
.
metamodel
,
dmc
.
intermediate_model
,
doml_ver
)
synth_req_store
=
RequirementStore
()
...
...
@@ -104,8 +104,8 @@ else:
print
(
"
\n
"
.
join
([
synth
.
pretty_ub_vals_attr
(
attr
)
for
attr
in
attrs_to_implement
]))
#
except Exception as e:
#
print(e)
except
Exception
as
e
:
print
(
e
)
else
:
try
:
...
...
This diff is collapsed.
Click to expand it.
mc_openapi/doml_mc/synthesis/synthesis.py
+
6
−
6
View file @
0c69ddd7
...
...
@@ -201,10 +201,10 @@ class Synthesis:
res
=
ctx
.
solver
.
check
()
if
res
==
sat
:
print
(
f
"
<Sat>
\t
ubelems_n=
{
ub_elems_n
}
, ubvals_n=
{
ub_vals_n
}
"
)
print
(
f
"
<Sat>
\t
ub
_
elems_n=
{
ub_elems_n
}
, ubvals_n=
{
ub_vals_n
}
"
)
return
ctx
elif
res
==
unsat
:
print
(
f
"
<Unsat>
\t
ubelems_n=
{
ub_elems_n
}
, ubvals_n=
{
ub_vals_n
}
"
)
print
(
f
"
<Unsat>
\t
ub
_
elems_n=
{
ub_elems_n
}
, ubvals_n=
{
ub_vals_n
}
"
)
if
ub_elems_n
>
ub_vals_n
:
new_ub_vals_n
=
ub_vals_n
*
2
if
ub_vals_n
>=
1
else
1
return
self
.
check
(
ub_elems_n
,
new_ub_vals_n
,
reqs
,
curr_try
+
1
,
max_tries
)
...
...
@@ -284,9 +284,9 @@ class Synthesis:
if
res
==
sat
:
print
(
"
SAT:
\t
Adding one more constraint and trying again
"
)
# Get new ubelems_and_assoc
# Get new ub
_
elems_and_assoc
model
=
ctx
.
solver
.
model
()
thinned_ub_elems_and_assoc
=
self
.
get_ubelems_and_assoc
(
ctx
,
model
)
thinned_ub_elems_and_assoc
=
self
.
get_ub
_
elems_and_assoc
(
ctx
,
model
)
# Print table showing the diff
from
difflib
import
context_diff
...
...
@@ -321,14 +321,14 @@ class Synthesis:
if
res
==
sat
:
print
(
"
SAT:
\t
Adding one more constraint and trying again
"
)
# Get new ubelems_and_assoc
# Get new ub
_
elems_and_assoc
model
=
ctx
.
solver
.
model
()
thinned_ub_vals_and_attr
=
self
.
get_ubvals_and_attr
(
ctx
,
model
)
# Print table showing the diff
from
difflib
import
context_diff
uvar_as_text
=
lambda
input
:
[
self
.
pretty_ubvals_attrs
(
attr
)
for
attr
in
input
]
print
(
"
\n
"
.
join
([
a
for
a
in
context_diff
(
uvar_as_text
(
self
.
ubelem
s_and_a
ssoc
),
uvar_as_text
(
thinned_ub_vals_and_attr
),
lineterm
=
""
,
fromfile
=
'
Before
'
,
tofile
=
"
After
"
)]))
print
(
"
\n
"
.
join
([
a
for
a
in
context_diff
(
uvar_as_text
(
ub_val
s_and_a
ttr
),
uvar_as_text
(
thinned_ub_vals_and_attr
),
lineterm
=
""
,
fromfile
=
'
Before
'
,
tofile
=
"
After
"
)]))
# Iterate
return
self
.
thin_ub_vals_and_attr
(
ctx
,
thinned_ub_vals_and_attr
)
...
...
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