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
1e7121a6
Commit
1e7121a6
authored
10 years ago
by
Etienne Kneuss
Browse files
Options
Downloads
Patches
Plain Diff
Re-introduce secific CVC4 implementations, fix scala-smtlib
parent
42999911
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
project/Build.scala
+1
-1
1 addition, 1 deletion
project/Build.scala
src/main/scala/leon/solvers/smtlib/SMTLIBCVC4Target.scala
+27
-27
27 additions, 27 deletions
src/main/scala/leon/solvers/smtlib/SMTLIBCVC4Target.scala
with
28 additions
and
28 deletions
project/Build.scala
+
1
−
1
View file @
1e7121a6
...
...
@@ -80,6 +80,6 @@ object Leon extends Build {
def
project
(
repo
:
String
,
version
:
String
)
=
RootProject
(
uri
(
s
"${repo}#${version}"
))
lazy
val
bonsai
=
project
(
"git://github.com/colder/bonsai.git"
,
"8f485605785bda98ac61885b0c8036133783290a"
)
lazy
val
scalaSmtLib
=
project
(
"git://github.com/regb/scala-smtlib.git"
,
"
e676aab157382847b27eb436b43d2e0abd8e29ba
"
)
lazy
val
scalaSmtLib
=
project
(
"git://github.com/regb/scala-smtlib.git"
,
"
acd60b52bac56e47ef1b855d91a1515a6d9178de
"
)
}
}
This diff is collapsed.
Click to expand it.
src/main/scala/leon/solvers/smtlib/SMTLIBCVC4Target.scala
+
27
−
27
View file @
1e7121a6
...
...
@@ -60,42 +60,42 @@ trait SMTLIBCVC4Target extends SMTLIBTarget {
}
override
def
toSMT
(
e
:
Expr
)(
implicit
bindings
:
Map
[
Identifier
,
Term
])
=
e
match
{
//
case a @ FiniteArray(elems) =>
//
val tpe @ ArrayType(base) = normalizeType(a.getType)
//
declareSort(tpe)
case
a
@
FiniteArray
(
elems
)
=>
val
tpe
@
ArrayType
(
base
)
=
normalizeType
(
a
.
getType
)
declareSort
(
tpe
)
//
var ar:
SExpr
= declareVariable(FreshIdentifier("arrayconst").setType(RawArrayType(Int32Type, base)))
var
ar
:
Term
=
declareVariable
(
FreshIdentifier
(
"arrayconst"
).
setType
(
RawArrayType
(
Int32Type
,
base
)))
//
for ((e, i) <- elems.zipWithIndex) {
//
ar =
SList
(SSymbol("store"), ar, toSMT(IntLiteral(i)), toSMT(e))
//
}
for
((
e
,
i
)
<-
elems
.
zipWithIndex
)
{
ar
=
FunctionApplication
(
SSymbol
(
"store"
),
Seq
(
ar
,
toSMT
(
IntLiteral
(
i
)),
toSMT
(
e
))
)
}
// SList
(constructors.toB(tpe), toSMT(IntLiteral(elems.size)), ar)
FunctionApplication
(
constructors
.
toB
(
tpe
),
Seq
(
toSMT
(
IntLiteral
(
elems
.
size
)),
ar
)
)
//
/**
//
* ===== Set operations =====
//
*/
//
case fs @ FiniteSet(elems) =>
//
if (elems.isEmpty) {
//
SList(SSymbol("as"),
SSymbol("emptyset"), declareSort(fs.getType))
//
} else {
//
SList(SSymbol("setenum") ::
elems.map(toSMT)
.toList
)
//
}
/**
* ===== Set operations =====
*/
case
fs
@
FiniteSet
(
elems
)
=>
if
(
elems
.
isEmpty
)
{
QualifiedIdentifier
(
SMTIdentifier
(
SSymbol
(
"emptyset"
)
)
,
Some
(
declareSort
(
fs
.
getType
))
)
}
else
{
FunctionApplication
(
SSymbol
(
"singleton"
),
elems
.
toSeq
.
map
(
toSMT
))
}
//
case SubsetOf(ss, s) =>
// SList
(SSymbol("subseteq"), toSMT(ss), toSMT(s))
case
SubsetOf
(
ss
,
s
)
=>
FunctionApplication
(
SSymbol
(
"subseteq"
),
Seq
(
toSMT
(
ss
),
toSMT
(
s
))
)
//
case ElementOfSet(e, s) =>
// SList
(SSymbol("in"), toSMT(e), toSMT(s))
case
ElementOfSet
(
e
,
s
)
=>
FunctionApplication
(
SSymbol
(
"in"
),
Seq
(
toSMT
(
e
),
toSMT
(
s
))
)
//
case SetDifference(a, b) =>
// SList
(SSymbol("setminus"), toSMT(a), toSMT(b))
case
SetDifference
(
a
,
b
)
=>
FunctionApplication
(
SSymbol
(
"setminus"
),
Seq
(
toSMT
(
a
),
toSMT
(
b
))
)
//
case SetUnion(a, b) =>
// SList
(SSymbol("union"), toSMT(a), toSMT(b))
case
SetUnion
(
a
,
b
)
=>
FunctionApplication
(
SSymbol
(
"union"
),
Seq
(
toSMT
(
a
),
toSMT
(
b
))
)
//
case SetIntersection(a, b) =>
// SList
(SSymbol("intersection"), toSMT(a), toSMT(b))
case
SetIntersection
(
a
,
b
)
=>
FunctionApplication
(
SSymbol
(
"intersection"
),
Seq
(
toSMT
(
a
),
toSMT
(
b
))
)
case
_
=>
super
[
SMTLIBTarget
].
toSMT
(
e
)
...
...
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