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
6cdfa722
Commit
6cdfa722
authored
6 years ago
by
Romain Ruetschi
Committed by
Nicolas Voirol
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix always true equality test in Templates
parent
eb2c919d
No related branches found
No related tags found
1 merge request
!89
Fix always true equality test in Templates
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/scala/inox/solvers/unrolling/QuantificationTemplates.scala
+5
-3
5 additions, 3 deletions
...cala/inox/solvers/unrolling/QuantificationTemplates.scala
src/main/scala/inox/solvers/unrolling/Templates.scala
+1
-1
1 addition, 1 deletion
src/main/scala/inox/solvers/unrolling/Templates.scala
with
6 additions
and
4 deletions
src/main/scala/inox/solvers/unrolling/QuantificationTemplates.scala
+
5
−
3
View file @
6cdfa722
...
...
@@ -70,15 +70,17 @@ trait QuantificationTemplates { self: Templates =>
* formula. Positive and negative polarity enable optimizations during
* quantifier instantiation.
*/
sealed
abstract
class
Polarity
{
sealed
abstract
class
Polarity
(
val
isPositive
:
Boolean
)
{
val
isNegative
:
Boolean
=
!
isPositive
def
substitute
(
substituter
:
Encoded
=>
Encoded
,
msubst
:
Map
[
Encoded
,
Matcher
])
:
Polarity
=
this
match
{
case
Positive
(
subst
)
=>
Positive
(
subst
.
map
(
p
=>
p
.
_1
->
p
.
_2
.
substitute
(
substituter
,
msubst
)))
case
Negative
(
insts
)
=>
Negative
(
insts
.
_1
->
substituter
(
insts
.
_2
))
}
}
case
class
Positive
(
subst
:
Map
[
Variable
,
Arg
])
extends
Polarity
case
class
Negative
(
insts
:
(
Variable
,
Encoded
))
extends
Polarity
case
class
Positive
(
subst
:
Map
[
Variable
,
Arg
])
extends
Polarity
(
true
)
case
class
Negative
(
insts
:
(
Variable
,
Encoded
))
extends
Polarity
(
false
)
class
QuantificationTemplate
private
[
QuantificationTemplates
]
(
val
polarity
:
Polarity
,
...
...
This diff is collapsed.
Click to expand it.
src/main/scala/inox/solvers/unrolling/Templates.scala
+
1
−
1
View file @
6cdfa722
...
...
@@ -770,7 +770,7 @@ trait Templates
// instantiate positive quantifications last to avoid introducing
// extra quantifier instantiations that arise due to empty domains
val
(
others
,
positives
)
=
quants
.
partition
(
_
.
polarity
!=
Posi
tive
)
val
(
others
,
positives
)
=
quants
.
partition
(
_
.
polarity
.
isNega
tive
)
for
(
q
<-
others
++
positives
)
{
val
substMap
=
subst
.
mapValues
(
_
.
encoded
)
val
substQuant
=
q
.
substitute
(
mkSubstituter
(
substMap
),
matcherSubst
)
...
...
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