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
28eaf0ed
Commit
28eaf0ed
authored
12 years ago
by
Etienne Kneuss
Browse files
Options
Downloads
Patches
Plain Diff
Generate a proper error in ground rule
parent
6e5f1718
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/scala/leon/synthesis/Rules.scala
+6
-2
6 additions, 2 deletions
src/main/scala/leon/synthesis/Rules.scala
testcases/Choose.scala
+1
-0
1 addition, 0 deletions
testcases/Choose.scala
with
7 additions
and
2 deletions
src/main/scala/leon/synthesis/Rules.scala
+
6
−
2
View file @
28eaf0ed
...
@@ -3,6 +3,7 @@ package synthesis
...
@@ -3,6 +3,7 @@ package synthesis
import
purescala.Common._
import
purescala.Common._
import
purescala.Trees._
import
purescala.Trees._
import
purescala.TypeTrees._
object
Rules
{
object
Rules
{
def
all
(
synth
:
Synthesizer
)
=
List
(
def
all
(
synth
:
Synthesizer
)
=
List
(
...
@@ -65,16 +66,19 @@ class OnePoint(synth: Synthesizer) extends Rule("One-point", synth) {
...
@@ -65,16 +66,19 @@ class OnePoint(synth: Synthesizer) extends Rule("One-point", synth) {
class
Ground
(
synth
:
Synthesizer
)
extends
Rule
(
"Ground"
,
synth
)
{
class
Ground
(
synth
:
Synthesizer
)
extends
Rule
(
"Ground"
,
synth
)
{
def
isApplicable
(
p
:
Problem
,
parent
:
Task
)
:
List
[
Task
]
=
{
def
isApplicable
(
p
:
Problem
,
parent
:
Task
)
:
List
[
Task
]
=
{
if
(
p
.
as
.
isEmpty
)
{
if
(
p
.
as
.
isEmpty
)
{
val
tpe
=
TupleType
(
p
.
xs
.
map
(
_
.
getType
))
synth
.
solveSAT
(
p
.
phi
)
match
{
synth
.
solveSAT
(
p
.
phi
)
match
{
case
(
Some
(
true
),
model
)
=>
case
(
Some
(
true
),
model
)
=>
val
onSuccess
:
List
[
Solution
]
=>
Solution
=
{
val
onSuccess
:
List
[
Solution
]
=>
Solution
=
{
case
Nil
=>
Solution
(
BooleanLiteral
(
true
),
Tuple
(
p
.
xs
.
map
(
model
)))
case
Nil
=>
Solution
(
BooleanLiteral
(
true
),
Tuple
(
p
.
xs
.
map
(
model
))
.
setType
(
tpe
)
)
}
}
List
(
new
Task
(
synth
,
parent
,
this
,
p
,
Nil
,
onSuccess
,
200
))
List
(
new
Task
(
synth
,
parent
,
this
,
p
,
Nil
,
onSuccess
,
200
))
case
(
Some
(
false
),
model
)
=>
case
(
Some
(
false
),
model
)
=>
val
onSuccess
:
List
[
Solution
]
=>
Solution
=
{
val
onSuccess
:
List
[
Solution
]
=>
Solution
=
{
case
Nil
=>
Solution
(
BooleanLiteral
(
false
),
BooleanLiteral
(
fals
e
))
case
Nil
=>
Solution
(
BooleanLiteral
(
false
),
Error
(
p
.
phi
+
" is UNSAT!"
).
setType
(
tp
e
))
}
}
List
(
new
Task
(
synth
,
parent
,
this
,
p
,
Nil
,
onSuccess
,
200
))
List
(
new
Task
(
synth
,
parent
,
this
,
p
,
Nil
,
onSuccess
,
200
))
...
...
This diff is collapsed.
Click to expand it.
testcases/Choose.scala
+
1
−
0
View file @
28eaf0ed
...
@@ -3,6 +3,7 @@ import leon.Utils._
...
@@ -3,6 +3,7 @@ import leon.Utils._
object
ChooseTest
{
object
ChooseTest
{
def
c0
()
:
Int
=
choose
{
(
x1
:
Int
)
=>
x1
>
13
}
def
c0
()
:
Int
=
choose
{
(
x1
:
Int
)
=>
x1
>
13
}
def
b0
()
:
Int
=
choose
{
(
x1
:
Int
)
=>
x1
>
13
&&
x1
<
2
}
def
c1
(
a
:
Int
)
:
Int
=
choose
{
(
x1
:
Int
)
=>
x1
>
a
}
def
c1
(
a
:
Int
)
:
Int
=
choose
{
(
x1
:
Int
)
=>
x1
>
a
}
def
c2
(
a
:
Int
)
:
(
Int
,
Int
)
=
choose
{
(
x1
:
Int
,
x2
:
Int
)
=>
x1
>
a
&&
x2
>
a
}
def
c2
(
a
:
Int
)
:
(
Int
,
Int
)
=
choose
{
(
x1
:
Int
,
x2
:
Int
)
=>
x1
>
a
&&
x2
>
a
}
...
...
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