Merge lp:~tapaal-ltl/verifypn/ltl-neg-fix into lp:verifypn

Proposed by Peter Gjøl Jensen
Status: Merged
Approved by: Jiri Srba
Approved revision: 237
Merged at revision: 238
Proposed branch: lp:~tapaal-ltl/verifypn/ltl-neg-fix
Merge into: lp:verifypn
Diff against target: 40 lines (+8/-3)
1 file modified
src/PetriEngine/PQL/Expressions.cpp (+8/-3)
To merge this branch: bzr merge lp:~tapaal-ltl/verifypn/ltl-neg-fix
Reviewer Review Type Date Requested Status
Jiri Srba Approve
tapaal-ltl Pending
Review via email: mp+402994@code.launchpad.net

Commit message

fixes issue with pushNegation that adds extra negation to outermost quantifier in each call.

Description of the change

fixes issue with pushNegation that adds extra negation to outermost quantifier in each call.

To post a comment you must log in.
Revision history for this message
Jiri Srba (srba) wrote :

Correctness recovered for P/T and CPN nets in LTL category - tested againt oracle.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/PetriEngine/PQL/Expressions.cpp'
--- src/PetriEngine/PQL/Expressions.cpp 2021-04-14 11:51:52 +0000
+++ src/PetriEngine/PQL/Expressions.cpp 2021-05-19 14:15:34 +0000
@@ -3547,6 +3547,7 @@
3547 }, stats, context, nested, negated, initrw);3547 }, stats, context, nested, negated, initrw);
3548 }3548 }
35493549
3550 /*LTL negation push*/
3550 Condition_ptr3551 Condition_ptr
3551 UntilCondition::pushNegation(negstat_t &stats, const EvaluationContext &context, bool nested, bool negated,3552 UntilCondition::pushNegation(negstat_t &stats, const EvaluationContext &context, bool nested, bool negated,
3552 bool initrw) {3553 bool initrw) {
@@ -3623,14 +3624,17 @@
36233624
3624 Condition_ptr ACondition::pushNegation(negstat_t &stats, const EvaluationContext &context, bool nested, bool negated,3625 Condition_ptr ACondition::pushNegation(negstat_t &stats, const EvaluationContext &context, bool nested, bool negated,
3625 bool initrw) {3626 bool initrw) {
3626 return ECondition(std::make_shared<NotCondition>(_cond)).pushNegation(stats, context, nested, !negated, initrw);3627 return ECondition(std::make_shared<NotCondition>(_cond))
3628 .pushNegation(stats, context, nested, !negated, initrw);
3627 }3629 }
36283630
36293631
3630 Condition_ptr ECondition::pushNegation(negstat_t &stats, const EvaluationContext &context, bool nested, bool negated,3632 Condition_ptr ECondition::pushNegation(negstat_t &stats, const EvaluationContext &context, bool nested, bool negated,
3631 bool initrw) {3633 bool initrw) {
3632 auto _sub = _cond->pushNegation(stats, context, nested, !negated, initrw);3634 // we forward the negated flag, we flip the outer quantifier later!
3633 return negated ? (Condition_ptr)std::make_shared<ACondition>(_sub) : (Condition_ptr)std::make_shared<ECondition>(_sub);3635 auto _sub = _cond->pushNegation(stats, context, nested, negated, initrw);
3636 if(negated) return std::make_shared<ACondition>(_sub);
3637 else return std::make_shared<ECondition>(_sub);
3634 }3638 }
36353639
3636 Condition_ptr GCondition::pushNegation(negstat_t &stats, const EvaluationContext &context, bool nested, bool negated,3640 Condition_ptr GCondition::pushNegation(negstat_t &stats, const EvaluationContext &context, bool nested, bool negated,
@@ -3638,6 +3642,7 @@
3638 return FCondition(std::make_shared<NotCondition>(_cond)).pushNegation(stats, context, nested, !negated, initrw);3642 return FCondition(std::make_shared<NotCondition>(_cond)).pushNegation(stats, context, nested, !negated, initrw);
3639 }3643 }
36403644
3645 /*Boolean connectives */
3641 Condition_ptr pushAnd(const std::vector<Condition_ptr>& _conds, negstat_t& stats, const EvaluationContext& context, bool nested, bool negate_children, bool initrw)3646 Condition_ptr pushAnd(const std::vector<Condition_ptr>& _conds, negstat_t& stats, const EvaluationContext& context, bool nested, bool negate_children, bool initrw)
3642 {3647 {
3643 std::vector<Condition_ptr> nef, other; 3648 std::vector<Condition_ptr> nef, other;

Subscribers

People subscribed via source and target branches