Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inox
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
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
LARA
inox
Commits
c1f957b5
Commit
c1f957b5
authored
9 years ago
by
Mikaël Mayer
Browse files
Options
Downloads
Patches
Plain Diff
Added example simplification when asking questions.
parent
ce61a86d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/scala/leon/purescala/ExprOps.scala
+6
-0
6 additions, 0 deletions
src/main/scala/leon/purescala/ExprOps.scala
src/main/scala/leon/synthesis/disambiguation/QuestionBuilder.scala
+4
-1
4 additions, 1 deletion
...scala/leon/synthesis/disambiguation/QuestionBuilder.scala
with
10 additions
and
1 deletion
src/main/scala/leon/purescala/ExprOps.scala
+
6
−
0
View file @
c1f957b5
...
@@ -1440,6 +1440,12 @@ object ExprOps {
...
@@ -1440,6 +1440,12 @@ object ExprOps {
case
Minus
(
Plus
(
e1
,
e2
),
Plus
(
e3
,
e4
))
if
e1
==
e4
&&
e2
==
e3
=>
InfiniteIntegerLiteral
(
0
)
case
Minus
(
Plus
(
e1
,
e2
),
Plus
(
e3
,
e4
))
if
e1
==
e4
&&
e2
==
e3
=>
InfiniteIntegerLiteral
(
0
)
case
Minus
(
Plus
(
e1
,
e2
),
Plus
(
Plus
(
e3
,
e4
),
e5
))
if
e1
==
e4
&&
e2
==
e3
=>
UMinus
(
e5
)
case
Minus
(
Plus
(
e1
,
e2
),
Plus
(
Plus
(
e3
,
e4
),
e5
))
if
e1
==
e4
&&
e2
==
e3
=>
UMinus
(
e5
)
case
StringConcat
(
StringLiteral
(
""
),
a
)
=>
a
case
StringConcat
(
a
,
StringLiteral
(
""
))
=>
a
case
StringConcat
(
StringLiteral
(
a
),
StringLiteral
(
b
))
=>
StringLiteral
(
a
+
b
)
case
StringConcat
(
StringLiteral
(
a
),
StringConcat
(
StringLiteral
(
b
),
c
))
=>
StringConcat
(
StringLiteral
(
a
+
b
),
c
)
case
StringConcat
(
StringConcat
(
c
,
StringLiteral
(
a
)),
StringLiteral
(
b
))
=>
StringConcat
(
c
,
StringLiteral
(
a
+
b
))
case
StringConcat
(
a
,
StringConcat
(
b
,
c
))
=>
StringConcat
(
StringConcat
(
a
,
b
),
c
)
//default
//default
case
e
=>
e
case
e
=>
e
}).
copiedFrom
(
expr
)
}).
copiedFrom
(
expr
)
...
...
This diff is collapsed.
Click to expand it.
src/main/scala/leon/synthesis/disambiguation/QuestionBuilder.scala
+
4
−
1
View file @
c1f957b5
...
@@ -136,7 +136,10 @@ class QuestionBuilder[T <: Expr](
...
@@ -136,7 +136,10 @@ class QuestionBuilder[T <: Expr](
val
model
=
new
ModelBuilder
val
model
=
new
ModelBuilder
model
++=
elems
model
++=
elems
val
modelResult
=
model
.
result
()
val
modelResult
=
model
.
result
()
e
.
eval
(
s
.
term
,
modelResult
).
result
.
map
(
_
.
_1
)
for
{
x
<-
e
.
eval
(
s
.
term
,
modelResult
).
result
res
=
x
.
_1
simp
=
ExprOps
.
simplifyArithmetic
(
res
)}
yield
simp
}
}
/** Returns a list of input/output questions to ask to the user. */
/** Returns a list of input/output questions to ask to the user. */
...
...
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