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
d3f14b31
Commit
d3f14b31
authored
13 years ago
by
Régis Blanc
Browse files
Options
Downloads
Patches
Plain Diff
Better return results when it is impossible to compute the model
parent
8f859490
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/Evaluator.scala
+4
-4
4 additions, 4 deletions
src/main/scala/leon/Evaluator.scala
src/main/scala/leon/FairZ3Solver.scala
+2
-2
2 additions, 2 deletions
src/main/scala/leon/FairZ3Solver.scala
with
6 additions
and
6 deletions
src/main/scala/leon/Evaluator.scala
+
4
−
4
View file @
d3f14b31
...
@@ -24,7 +24,7 @@ object Evaluator {
...
@@ -24,7 +24,7 @@ object Evaluator {
case
class
InfiniteComputation
()
extends
EvaluationResult
{
case
class
InfiniteComputation
()
extends
EvaluationResult
{
val
finalResult
=
None
val
finalResult
=
None
}
}
case
class
PostconditionViolationFunctionFromModel
()
extends
EvaluationResult
{
case
class
ImpossibleComputation
()
extends
EvaluationResult
{
val
finalResult
=
None
val
finalResult
=
None
}
}
...
@@ -33,7 +33,7 @@ object Evaluator {
...
@@ -33,7 +33,7 @@ object Evaluator {
case
class
RuntimeErrorEx
(
msg
:
String
)
extends
Exception
case
class
RuntimeErrorEx
(
msg
:
String
)
extends
Exception
case
class
InfiniteComputationEx
()
extends
Exception
case
class
InfiniteComputationEx
()
extends
Exception
case
class
TypeErrorEx
(
typeError
:
TypeError
)
extends
Exception
case
class
TypeErrorEx
(
typeError
:
TypeError
)
extends
Exception
case
class
PostconditionViolationFunctionFromModel
Ex
()
extends
Exception
case
class
ImpossibleComputation
Ex
()
extends
Exception
var
left
:
Int
=
maxSteps
var
left
:
Int
=
maxSteps
...
@@ -101,7 +101,7 @@ object Evaluator {
...
@@ -101,7 +101,7 @@ object Evaluator {
val
postBody
=
replace
(
Map
(
ResultVariable
()
->
Variable
(
freshResID
)),
matchToIfThenElse
(
fd
.
postcondition
.
get
))
val
postBody
=
replace
(
Map
(
ResultVariable
()
->
Variable
(
freshResID
)),
matchToIfThenElse
(
fd
.
postcondition
.
get
))
rec
(
frame
+
((
freshResID
->
callResult
)),
postBody
)
match
{
rec
(
frame
+
((
freshResID
->
callResult
)),
postBody
)
match
{
case
BooleanLiteral
(
true
)
=>
;
case
BooleanLiteral
(
true
)
=>
;
case
BooleanLiteral
(
false
)
if
!
fd
.
hasImplementation
=>
throw
PostconditionViolationFunctionFromModel
Ex
()
case
BooleanLiteral
(
false
)
if
!
fd
.
hasImplementation
=>
throw
ImpossibleComputation
Ex
()
case
BooleanLiteral
(
false
)
=>
throw
RuntimeErrorEx
(
"Postcondition violation for "
+
fd
.
id
.
name
+
" reached in evaluation."
)
case
BooleanLiteral
(
false
)
=>
throw
RuntimeErrorEx
(
"Postcondition violation for "
+
fd
.
id
.
name
+
" reached in evaluation."
)
case
other
=>
throw
TypeErrorEx
(
TypeError
(
other
,
BooleanType
))
case
other
=>
throw
TypeErrorEx
(
TypeError
(
other
,
BooleanType
))
}
}
...
@@ -313,7 +313,7 @@ object Evaluator {
...
@@ -313,7 +313,7 @@ object Evaluator {
case
RuntimeErrorEx
(
msg
)
=>
RuntimeError
(
msg
)
case
RuntimeErrorEx
(
msg
)
=>
RuntimeError
(
msg
)
case
InfiniteComputationEx
()
=>
InfiniteComputation
()
case
InfiniteComputationEx
()
=>
InfiniteComputation
()
case
TypeErrorEx
(
te
)
=>
te
case
TypeErrorEx
(
te
)
=>
te
case
PostconditionViolationFunctionFromModelEx
()
=>
PostconditionViolationFunctionFromModel
()
case
ImpossibleComputationEx
()
=>
ImpossibleComputation
()
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main/scala/leon/FairZ3Solver.scala
+
2
−
2
View file @
d3f14b31
...
@@ -827,8 +827,8 @@ class FairZ3Solver(reporter: Reporter) extends Solver(reporter) with AbstractZ3S
...
@@ -827,8 +827,8 @@ class FairZ3Solver(reporter: Reporter) extends Solver(reporter) with AbstractZ3S
reporter
.
info
(
"- Invalid model."
)
reporter
.
info
(
"- Invalid model."
)
(
false
,
asMap
)
(
false
,
asMap
)
}
}
case
PostconditionViolationFunctionFromModel
()
=>
{
case
ImpossibleComputation
()
=>
{
reporter
.
info
(
"- Invalid Model:
postcondition violation of a function that whose implementation was specified by the model
"
)
reporter
.
info
(
"- Invalid Model:
the model could not be verified because of insufficient information.
"
)
(
false
,
asMap
)
(
false
,
asMap
)
}
}
case
other
=>
{
case
other
=>
{
...
...
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