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
bba8bc86
Commit
bba8bc86
authored
10 years ago
by
Nicolas Voirol
Committed by
Etienne Kneuss
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Some small changes to get CVC4 smt solver working with HO functions
parent
bbe8b672
No related branches found
Branches containing commit
No related tags found
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/solvers/smtlib/SMTLIBCVC4Target.scala
+9
-0
9 additions, 0 deletions
src/main/scala/leon/solvers/smtlib/SMTLIBCVC4Target.scala
src/main/scala/leon/solvers/templates/UnrollingBank.scala
+13
-3
13 additions, 3 deletions
src/main/scala/leon/solvers/templates/UnrollingBank.scala
with
22 additions
and
3 deletions
src/main/scala/leon/solvers/smtlib/SMTLIBCVC4Target.scala
+
9
−
0
View file @
bba8bc86
...
...
@@ -78,6 +78,15 @@ trait SMTLIBCVC4Target extends SMTLIBTarget {
case
FiniteSet
(
elems
)
=>
elems
}).
flatten
.
toSet
).
setType
(
tpe
)
// FIXME (nicolas)
// some versions of CVC4 seem to generate array constants with "as const" notation instead of the __array_store_all__
// one I've witnessed up to now. Don't know why this is happening...
case
(
FunctionApplication
(
QualifiedIdentifier
(
SMTIdentifier
(
SSymbol
(
"const"
),
_
),
_
),
Seq
(
elem
)),
ft
@
FunctionType
(
from
,
to
))
=>
FiniteLambda
(
fromSMT
(
elem
,
to
),
Seq
.
empty
,
ft
)
case
(
FunctionApplication
(
QualifiedIdentifier
(
SMTIdentifier
(
SSymbol
(
"const"
),
_
),
_
),
Seq
(
elem
)),
RawArrayType
(
k
,
v
))
=>
RawArrayValue
(
k
,
Map
(),
fromSMT
(
elem
,
v
))
case
_
=>
super
[
SMTLIBTarget
].
fromSMT
(
s
,
tpe
)
}
...
...
This diff is collapsed.
Click to expand it.
src/main/scala/leon/solvers/templates/UnrollingBank.scala
+
13
−
3
View file @
bba8bc86
...
...
@@ -157,6 +157,7 @@ class UnrollingBank[T](reporter: Reporter, templateGenerator: TemplateGenerator[
private
def
extendAppBlock
(
app
:
(
T
,
App
[
T
]),
infos
:
Set
[
TemplateAppInfo
[
T
]])
:
T
=
{
assert
(!
appInfo
.
isDefinedAt
(
app
),
"appInfo -= app must have been called to ensure blocker freshness"
)
assert
(
appBlockers
.
isDefinedAt
(
app
),
"freshAppBlocks must have been called on app before it can be unlocked"
)
assert
(
infos
.
nonEmpty
,
"No point in extending blockers if no templates have been unrolled!"
)
val
nextB
=
encoder
.
encodeId
(
FreshIdentifier
(
"b_lambda"
,
true
).
setType
(
BooleanType
))
val
extension
=
encoder
.
mkOr
((
infos
.
map
(
_
.
equals
).
toSeq
:+
nextB
)
:
_
*
)
...
...
@@ -194,7 +195,14 @@ class UnrollingBank[T](reporter: Reporter, templateGenerator: TemplateGenerator[
}
// ...so we must force it to true!
template
.
start
+:
(
newClauses
++
blockClauses
)
val
clauses
=
template
.
start
+:
(
newClauses
++
blockClauses
)
reporter
.
debug
(
"Generating clauses for: "
+
expr
)
for
(
cls
<-
clauses
)
{
reporter
.
debug
(
" . "
+
cls
)
}
clauses
}
def
nextGeneration
(
gen
:
Int
)
=
gen
+
3
...
...
@@ -238,8 +246,10 @@ class UnrollingBank[T](reporter: Reporter, templateGenerator: TemplateGenerator[
blockerToApp
=
blockerToApp
--
ids
appInfo
=
appInfo
--
apps
for
((
app
,
(
_
,
_
,
_
,
_
,
infos
))
<-
appInfos
)
{
newClauses
:+=
extendAppBlock
(
app
,
infos
)
for
((
app
,
(
_
,
_
,
_
,
_
,
infos
))
<-
appInfos
if
infos
.
nonEmpty
)
{
val
extension
=
extendAppBlock
(
app
,
infos
)
reporter
.
debug
(
" -> extending lambda blocker: "
+
extension
)
newClauses
:+=
extension
}
for
((
id
,
(
gen
,
_
,
_
,
infos
))
<-
callInfos
;
info
@
TemplateCallInfo
(
tfd
,
args
)
<-
infos
)
{
...
...
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