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
8cf2104a
Commit
8cf2104a
authored
8 years ago
by
Nicolas Voirol
Browse files
Options
Downloads
Patches
Plain Diff
checkAssumptions for EnumerationSolver, fixed Unsat case
parent
66533da2
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/main/scala/inox/solvers/EnumerationSolver.scala
+21
-12
21 additions, 12 deletions
src/main/scala/inox/solvers/EnumerationSolver.scala
with
21 additions
and
12 deletions
src/main/scala/inox/solvers/EnumerationSolver.scala
+
21
−
12
View file @
8cf2104a
...
...
@@ -12,7 +12,6 @@ import datagen._
trait
EnumerationSolver
extends
Solver
{
self
=>
val
grammars
:
GrammarsUniverse
{
val
program:
self.program.
type
}
val
evaluator:
DeterministicEvaluator
{
val
program:
self.program.
type
}
import
program._
...
...
@@ -62,6 +61,7 @@ trait EnumerationSolver extends Solver { self =>
val
program
:
self.program.
type
=
self
.
program
def
functionsAvailable
(
p
:
Program
)
:
Set
[
FunDef
]
=
Set
()
})
if
(
interrupted
)
{
Unknown
}
else
{
...
...
@@ -71,19 +71,22 @@ trait EnumerationSolver extends Solver { self =>
val
it
:
Iterator
[
Seq
[
Expr
]]
=
datagen
.
get
.
generateFor
(
allFreeVars
,
andJoin
(
allConstraints
),
1
,
maxTried
)
if
(
it
.
hasNext
)
{
config
match
{
case
All
|
Model
=>
val
varModels
=
it
.
next
SatWithModel
(
allFreeVars
.
zip
(
varModels
).
toMap
)
case
_
=>
Sat
if
(
config
.
withModel
)
{
val
varModels
=
it
.
next
SatWithModel
(
allFreeVars
.
zip
(
varModels
).
toMap
)
}
else
{
Sat
}
}
else
{
config
match
{
case
All
|
Cores
=>
???
// TODO
case
_
=>
val
cardinalities
=
allFreeVars
.
map
(
vd
=>
typeCardinality
(
vd
.
tpe
))
if
(
cardinalities
.
forall
(
_
.
isDefined
)
&&
cardinalities
.
flatten
.
product
<
maxTried
)
{
if
(
config
.
withCores
)
{
UnsatWithCores
(
Set
.
empty
)
}
else
{
Unsat
}
}
else
{
Unknown
}
}
}
...
...
@@ -95,7 +98,13 @@ trait EnumerationSolver extends Solver { self =>
res
}
def
checkAssumptions
(
config
:
Configuration
)(
assumptions
:
Set
[
Trees
])
:
config.Response
[
Model
,
Cores
]
=
???
// TODO
def
checkAssumptions
(
config
:
Configuration
)(
assumptions
:
Set
[
Expr
])
:
config.Response
[
Model
,
Cores
]
=
{
push
()
for
(
c
<-
assumptions
)
assertCnstr
(
c
)
val
res
=
check
(
config
)
pop
()
res
}
def
free
()
=
{
constraints
.
clear
()
...
...
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