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
017b8c9f
Commit
017b8c9f
authored
9 years ago
by
Mikaël Mayer
Browse files
Options
Downloads
Patches
Plain Diff
Corrected invariance bug.
parent
89648d0a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/scala/leon/synthesis/disambiguation/QuestionBuilder.scala
+5
-5
5 additions, 5 deletions
...scala/leon/synthesis/disambiguation/QuestionBuilder.scala
with
5 additions
and
5 deletions
src/main/scala/leon/synthesis/disambiguation/QuestionBuilder.scala
+
5
−
5
View file @
017b8c9f
...
@@ -34,8 +34,8 @@ object QuestionBuilder {
...
@@ -34,8 +34,8 @@ object QuestionBuilder {
// Add more if needed.
// Add more if needed.
/** Sort methods for question's answers. You can (and should) build your own. */
/** Sort methods for question's answers. You can (and should) build your own. */
abstract
class
AlternativeSortingType
[
-
T
<:
Expr
]
extends
Ordering
[
T
]
{
self
=>
abstract
class
AlternativeSortingType
[
T
<:
Expr
]
extends
Ordering
[
T
]
{
self
=>
/** Prioritizes this comparison operator agains the second one. */
/** Prioritizes this comparison operator agains
t
the second one. */
def
&&
(
other
:
AlternativeSortingType
[
T
])
:
AlternativeSortingType
[
T
]
=
new
AlternativeSortingType
[
T
]
{
def
&&
(
other
:
AlternativeSortingType
[
T
])
:
AlternativeSortingType
[
T
]
=
new
AlternativeSortingType
[
T
]
{
def
compare
(
e
:
T
,
f
:
T
)
:
Int
=
{
def
compare
(
e
:
T
,
f
:
T
)
:
Int
=
{
val
ce
=
self
.
compare
(
e
,
f
)
val
ce
=
self
.
compare
(
e
,
f
)
...
@@ -45,8 +45,8 @@ object QuestionBuilder {
...
@@ -45,8 +45,8 @@ object QuestionBuilder {
}
}
object
AlternativeSortingType
{
object
AlternativeSortingType
{
/** Presents shortest alternatives first */
/** Presents shortest alternatives first */
case
class
ShorterIsBetter
()(
implicit
c
:
LeonContext
)
extends
AlternativeSortingType
[
Expr
]
{
case
class
ShorterIsBetter
[
T
<:
Expr
]
()(
implicit
c
:
LeonContext
)
extends
AlternativeSortingType
[
T
]
{
def
compare
(
e
:
Expr
,
f
:
Expr
)
=
e
.
asString
.
length
-
f
.
asString
.
length
def
compare
(
e
:
T
,
f
:
T
)
=
e
.
asString
.
length
-
f
.
asString
.
length
}
}
/** Presents balanced alternatives first */
/** Presents balanced alternatives first */
case
class
BalancedParenthesisIsBetter
[
T
<:
Expr
]()(
implicit
c
:
LeonContext
)
extends
AlternativeSortingType
[
T
]
{
case
class
BalancedParenthesisIsBetter
[
T
<:
Expr
]()(
implicit
c
:
LeonContext
)
extends
AlternativeSortingType
[
T
]
{
...
@@ -87,7 +87,7 @@ class QuestionBuilder[T <: Expr](input: List[Identifier], ruleApplication: RuleC
...
@@ -87,7 +87,7 @@ class QuestionBuilder[T <: Expr](input: List[Identifier], ruleApplication: RuleC
import
QuestionBuilder._
import
QuestionBuilder._
private
var
_argTypes
=
input
.
map
(
_
.
getType
)
private
var
_argTypes
=
input
.
map
(
_
.
getType
)
private
var
_questionSorMethod
:
QuestionSortingType
=
QuestionSortingType
.
IncreasingInputSize
private
var
_questionSorMethod
:
QuestionSortingType
=
QuestionSortingType
.
IncreasingInputSize
private
var
_alternativeSortMethod
:
AlternativeSortingType
[
T
]
=
AlternativeSortingType
.
BalancedParenthesisIsBetter
()
&&
AlternativeSortingType
.
ShorterIsBetter
()
private
var
_alternativeSortMethod
:
AlternativeSortingType
[
T
]
=
AlternativeSortingType
.
BalancedParenthesisIsBetter
[
T
]
()
&&
AlternativeSortingType
.
ShorterIsBetter
[
T
]
()
private
var
solutionsToTake
=
15
private
var
solutionsToTake
=
15
private
var
expressionsToTake
=
15
private
var
expressionsToTake
=
15
...
...
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