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
1eb1c9ae
Commit
1eb1c9ae
authored
14 years ago
by
Robin Steiger
Browse files
Options
Downloads
Patches
Plain Diff
BAPA (without Unifier) now relaxes the formula only until AFTER negation.
parent
02bc0066
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/orderedsets/Main.scala
+6
-5
6 additions, 5 deletions
src/orderedsets/Main.scala
with
6 additions
and
5 deletions
src/orderedsets/Main.scala
+
6
−
5
View file @
1eb1c9ae
...
...
@@ -7,7 +7,7 @@ import Reconstruction.Model
import
RPrettyPrinter.rpp
class
Main
(
reporter
:
Reporter
)
extends
Solver
(
reporter
)
{
import
purescala.Trees.Expr
import
purescala.Trees.
{
Expr
,
expandLets
,
negate
}
import
AST.Formula
val
description
=
"BAPA with ordering"
override
val
shortDescription
=
"BAPA<"
...
...
@@ -22,14 +22,14 @@ class Main(reporter: Reporter) extends Solver(reporter) {
def
solve
(
exprWithLets
:
Expr
)
:
Option
[
Boolean
]
=
{
//reporter.info("INPUT to Ordered BAPA\n" + rpp(exprWithLets))
val
expr
=
purescala
.
Trees
.
expandLets
(
exprWithLets
)
val
expr
=
expandLets
(
exprWithLets
)
//reporter.info("INPUT to Ordered BAPA\n" + rpp(expr))
//reporter.info("Sets: " + ExprToASTConverter.getSetTypes(expr))
try
{
// Negate formula
(
Some
(!
solve
(
!
ExprToASTConverter
(
expr
,
reporter
))),
{
(
Some
(!
solve
(
ExprToASTConverter
(
negate
(
expr
)
,
reporter
))),
{
val
sets
=
ExprToASTConverter
.
getSetTypes
(
expr
)
if
(
sets
.
size
>
1
)
...
...
@@ -55,7 +55,8 @@ class Main(reporter: Reporter) extends Solver(reporter) {
// true means formula is SAT
// false means formula is UNSAT
def
solve
(
formula
:
Formula
)
:
Boolean
=
{
//reporter.info("BAPA< formula to be shown unsat:\n" + NormalForms.nnf(formula).toString)
reporter
.
info
(
"BAPA< formula to be shown unsat:\n"
+
formula
.
toString
)
// reporter.info("BAPA< formula to be shown unsat:\n" + NormalForms.nnf(formula).toString)
val
z3
=
new
Context
(
formula
,
reporter
)
val
startTime
=
System
.
nanoTime
...
...
@@ -217,7 +218,7 @@ object ExprToASTConverter {
toFormula
(
expr
)
}
catch
{
case
ConversionException
(
badExpr
,
msg
)
=>
//
reporter.warning("BAPA was relaxed : " + msg + " in " + badExpr.getClass + "\n" + rpp(badExpr))
reporter
.
warning
(
"BAPA was relaxed : "
+
msg
+
" in "
+
badExpr
.
getClass
+
"\n"
+
rpp
(
badExpr
))
formulaRelaxed
=
true
AST
.
True
// Assuming the formula to be True
}
...
...
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