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
32e0111d
Commit
32e0111d
authored
14 years ago
by
Philippe Suter
Browse files
Options
Downloads
Patches
Plain Diff
made CAV work as well as PLDI used to
parent
7b0a4088
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/purescala/Z3Solver.scala
+8
-8
8 additions, 8 deletions
src/purescala/Z3Solver.scala
with
8 additions
and
8 deletions
src/purescala/Z3Solver.scala
+
8
−
8
View file @
32e0111d
...
@@ -175,25 +175,25 @@ class Z3Solver(val reporter: Reporter) extends Solver(reporter) with Z3ModelReco
...
@@ -175,25 +175,25 @@ class Z3Solver(val reporter: Reporter) extends Solver(reporter) with Z3ModelReco
// ...and now everything should be in there...
// ...and now everything should be in there...
}
}
def
isKnownDef
(
funDef
:
FunDef
)
:
Boolean
=
if
(
useInstantiator
)
{
def
isKnownDef
(
funDef
:
FunDef
)
:
Boolean
=
if
(
use
Any
Instantiator
)
{
instantiator
.
isKnownDef
(
funDef
)
instantiator
.
isKnownDef
(
funDef
)
}
else
{
}
else
{
functionMap
.
isDefinedAt
(
funDef
)
functionMap
.
isDefinedAt
(
funDef
)
}
}
def
functionDefToDecl
(
funDef
:
FunDef
)
:
Z3FuncDecl
=
{
def
functionDefToDecl
(
funDef
:
FunDef
)
:
Z3FuncDecl
=
{
if
(
useInstantiator
)
{
if
(
use
Any
Instantiator
)
{
instantiator
.
functionDefToDecl
(
funDef
)
instantiator
.
functionDefToDecl
(
funDef
)
}
else
{
}
else
{
functionMap
.
getOrElse
(
funDef
,
scala
.
Predef
.
error
(
"No Z3 definition found for function symbol "
+
funDef
.
id
.
name
+
". (Instantiator is off)."
))
functionMap
.
getOrElse
(
funDef
,
scala
.
Predef
.
error
(
"No Z3 definition found for function symbol "
+
funDef
.
id
.
name
+
". (Instantiator is off)."
))
}
}
}
}
def
isKnownDecl
(
decl
:
Z3FuncDecl
)
:
Boolean
=
if
(
useInstantiator
)
{
def
isKnownDecl
(
decl
:
Z3FuncDecl
)
:
Boolean
=
if
(
use
Any
Instantiator
)
{
instantiator
.
isKnownDecl
(
decl
)
instantiator
.
isKnownDecl
(
decl
)
}
else
{
}
else
{
reverseFunctionMap
.
isDefinedAt
(
decl
)
reverseFunctionMap
.
isDefinedAt
(
decl
)
}
}
def
functionDeclToDef
(
decl
:
Z3FuncDecl
)
:
FunDef
=
{
def
functionDeclToDef
(
decl
:
Z3FuncDecl
)
:
FunDef
=
{
if
(
useInstantiator
)
{
if
(
use
Any
Instantiator
)
{
instantiator
.
functionDeclToDef
(
decl
)
instantiator
.
functionDeclToDef
(
decl
)
}
else
{
}
else
{
reverseFunctionMap
.
getOrElse
(
decl
,
scala
.
Predef
.
error
(
"No FunDef corresponds to Z3 definition "
+
decl
+
". (Instantiator is off)."
))
reverseFunctionMap
.
getOrElse
(
decl
,
scala
.
Predef
.
error
(
"No FunDef corresponds to Z3 definition "
+
decl
+
". (Instantiator is off)."
))
...
@@ -207,7 +207,7 @@ class Z3Solver(val reporter: Reporter) extends Solver(reporter) with Z3ModelReco
...
@@ -207,7 +207,7 @@ class Z3Solver(val reporter: Reporter) extends Solver(reporter) with Z3ModelReco
val
sortSeq
=
funDef
.
args
.
map
(
vd
=>
typeToSort
(
vd
.
tpe
))
val
sortSeq
=
funDef
.
args
.
map
(
vd
=>
typeToSort
(
vd
.
tpe
))
val
returnSort
=
typeToSort
(
funDef
.
returnType
)
val
returnSort
=
typeToSort
(
funDef
.
returnType
)
if
(
useInstantiator
)
{
if
(
use
Any
Instantiator
)
{
instantiator
.
registerFunction
(
funDef
,
sortSeq
,
returnSort
)
instantiator
.
registerFunction
(
funDef
,
sortSeq
,
returnSort
)
}
else
{
}
else
{
val
z3Decl
=
z3
.
mkFreshFuncDecl
(
funDef
.
id
.
name
,
sortSeq
,
returnSort
)
val
z3Decl
=
z3
.
mkFreshFuncDecl
(
funDef
.
id
.
name
,
sortSeq
,
returnSort
)
...
@@ -217,7 +217,7 @@ class Z3Solver(val reporter: Reporter) extends Solver(reporter) with Z3ModelReco
...
@@ -217,7 +217,7 @@ class Z3Solver(val reporter: Reporter) extends Solver(reporter) with Z3ModelReco
}
}
// Attempts to universally quantify all functions !
// Attempts to universally quantify all functions !
if
(!
Settings
.
noForallAxioms
&&
!
Settings
.
useInstantiator
)
{
if
(!
Settings
.
noForallAxioms
&&
!
Settings
.
use
Any
Instantiator
)
{
for
(
funDef
<-
program
.
definedFunctions
)
if
(
funDef
.
hasImplementation
/* && program.isRecursive(funDef) */
&&
funDef
.
args
.
size
>
0
)
{
for
(
funDef
<-
program
.
definedFunctions
)
if
(
funDef
.
hasImplementation
/* && program.isRecursive(funDef) */
&&
funDef
.
args
.
size
>
0
)
{
// println("Generating forall axioms for " + funDef.id.name)
// println("Generating forall axioms for " + funDef.id.name)
funDef
.
body
.
get
match
{
funDef
.
body
.
get
match
{
...
@@ -337,7 +337,7 @@ class Z3Solver(val reporter: Reporter) extends Solver(reporter) with Z3ModelReco
...
@@ -337,7 +337,7 @@ class Z3Solver(val reporter: Reporter) extends Solver(reporter) with Z3ModelReco
def
solve
(
vc
:
Expr
)
=
decide
(
vc
,
true
)
def
solve
(
vc
:
Expr
)
=
decide
(
vc
,
true
)
def
decide
(
vc
:
Expr
,
fv
:
Boolean
)
:
Option
[
Boolean
]
=
if
(
Settings
.
useInstantiator
)
{
def
decide
(
vc
:
Expr
,
fv
:
Boolean
)
:
Option
[
Boolean
]
=
if
(
Settings
.
use
Any
Instantiator
)
{
decideIterative
(
vc
,
fv
)
decideIterative
(
vc
,
fv
)
}
else
{
}
else
{
decideStandard
(
vc
,
fv
)
decideStandard
(
vc
,
fv
)
...
@@ -747,7 +747,7 @@ class Z3Solver(val reporter: Reporter) extends Solver(reporter) with Z3ModelReco
...
@@ -747,7 +747,7 @@ class Z3Solver(val reporter: Reporter) extends Solver(reporter) with Z3ModelReco
case
Z3NumeralAST
(
Some
(
v
))
=>
IntLiteral
(
v
)
case
Z3NumeralAST
(
Some
(
v
))
=>
IntLiteral
(
v
)
case
other
@
_
=>
{
case
other
@
_
=>
{
System
.
err
.
println
(
"Don't know what this is "
+
other
)
System
.
err
.
println
(
"Don't know what this is "
+
other
)
if
(
useInstantiator
)
{
if
(
use
Any
Instantiator
)
{
instantiator
.
dumpFunctionMap
instantiator
.
dumpFunctionMap
}
else
{
}
else
{
System
.
err
.
println
(
"REVERSE FUNCTION MAP:"
)
System
.
err
.
println
(
"REVERSE FUNCTION MAP:"
)
...
...
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