~verifypn-maintainers/verifypn/u4.2

« back to all changes in this revision

Viewing changes to include/PetriEngine/PQL/Expressions.h

  • Committer: srba.jiri at gmail
  • Date: 2021-07-07 12:02:50 UTC
  • mfrom: (233.1.63 update-parser)
  • Revision ID: srba.jiri@gmail.com-20210707120250-f86fv0m9ycbge3qs
merged in lp:~tapaal-contributor/verifypn/update-parser improving CPN unfodling and refactoring the code, fixing parser

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
            Expr::Types type() const override;
106
106
            Member constraint(SimplificationContext& context) const override;
107
107
            void toXML(std::ostream&, uint32_t tabs, bool tokencount = false) const override;
 
108
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const override;
108
109
            bool tk = false;
109
110
 
110
111
            void visit(Visitor& visitor) const override;
125
126
            Expr::Types type() const override;
126
127
            Member constraint(SimplificationContext& context) const override;
127
128
            void toXML(std::ostream&, uint32_t tabs, bool tokencount = false) const override;
 
129
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const override;
128
130
 
129
131
 
130
132
            void toBinary(std::ostream&) const override;
143
145
            Expr::Types type() const override;
144
146
            Member constraint(SimplificationContext& context) const override;
145
147
            void toXML(std::ostream&, uint32_t tabs, bool tokencount = false) const override;
 
148
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const override;
146
149
 
147
150
 
148
151
            void visit(Visitor& visitor) const override;
164
167
            Expr::Types type() const override;
165
168
            Member constraint(SimplificationContext& context) const override;
166
169
            void toXML(std::ostream&, uint32_t tabs, bool tokencount = false) const override;
 
170
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const override;
167
171
            void toBinary(std::ostream&) const override;
168
172
 
169
173
            void visit(Visitor& visitor) const override;
187
191
            int evaluate(const EvaluationContext& context) override;
188
192
            Expr::Types type() const override;
189
193
            void toXML(std::ostream&, uint32_t tabs, bool tokencount = false) const override;
 
194
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const override;
190
195
            void toBinary(std::ostream&) const override;
191
196
 
192
197
            void visit(Visitor& visitor) const override;
218
223
            void toXML(std::ostream& os, uint32_t tabs, bool tokencount = false) const override {
219
224
                _compiled->toXML(os, tabs, tokencount);
220
225
            }
 
226
            void toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const override;
221
227
 
222
228
            int formulaSize() const override {
223
229
                if(_compiled) return _compiled->formulaSize();
266
272
            int evaluate(const EvaluationContext& context) override;
267
273
            Expr::Types type() const override;
268
274
            void toXML(std::ostream&, uint32_t tabs, bool tokencount = false) const override;
 
275
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context, bool tokencount = false) const override;
269
276
            void toBinary(std::ostream&) const override;
270
277
            int formulaSize() const override{
271
278
                return 1;
309
316
 
310
317
            void toXML(std::ostream& out, uint32_t tabs) const override
311
318
            { _compiled->toXML(out, tabs); }
 
319
            void toCompactXML(std::ostream& out, uint32_t tabs, AnalysisContext& context) const override{
 
320
            }
312
321
 
313
322
 
314
323
            Quantifier getQuantifier() const override
376
385
            Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override;
377
386
            void toXML(std::ostream&, uint32_t tabs) const override;
378
387
            void toBinary(std::ostream&) const override;
 
388
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
379
389
 
380
390
 
381
391
            Quantifier getQuantifier() const override { return Quantifier::NEG; }
443
453
            Condition_ptr prepareForReachability(bool negated) const override;
444
454
            Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override;
445
455
            void toXML(std::ostream&, uint32_t tabs) const override;
 
456
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
446
457
            Quantifier getQuantifier() const override { return Quantifier::E; }
447
458
            Path getPath() const override             { return Path::pError; }
448
459
            uint32_t distance(DistanceContext& context) const override {
471
482
            Condition_ptr prepareForReachability(bool negated) const override;
472
483
            Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override;
473
484
            void toXML(std::ostream&, uint32_t tabs) const override;
 
485
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
474
486
            Quantifier getQuantifier() const override { return Quantifier::A; }
475
487
            Path getPath() const override             { return Path::pError; }
476
488
            uint32_t distance(DistanceContext& context) const override {
509
521
          Retval simplify(SimplificationContext &context) const override;
510
522
 
511
523
          void toXML(std::ostream &, uint32_t tabs) const override;
 
524
          void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
512
525
 
513
526
          Quantifier getQuantifier() const override { return Quantifier::EMPTY; }
514
527
 
550
563
            }
551
564
            Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override;
552
565
            void toXML(std::ostream&, uint32_t tabs) const override;
 
566
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
553
567
            Quantifier getQuantifier() const override { return Quantifier::EMPTY; }
554
568
            Path getPath() const override             { return Path::F; }
555
569
            uint32_t distance(DistanceContext& context) const override {
577
591
            Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override;
578
592
            Retval simplify(SimplificationContext& context) const override;
579
593
            void toXML(std::ostream&, uint32_t tabs) const override;
 
594
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
580
595
            Quantifier getQuantifier() const override { return Quantifier::EMPTY; }
581
596
            Path getPath() const override             { return Path::X; }
582
597
            uint32_t distance(DistanceContext& context) const override {
598
613
            Condition_ptr prepareForReachability(bool negated) const override;
599
614
            Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override;
600
615
            void toXML(std::ostream&, uint32_t tabs) const override;
 
616
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
601
617
            Quantifier getQuantifier() const override { return Quantifier::E; }
602
618
            Path getPath() const override             { return Path::X; }
603
619
            uint32_t distance(DistanceContext& context) const override;
618
634
            Condition_ptr prepareForReachability(bool negated) const override;
619
635
            Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override;
620
636
            void toXML(std::ostream&, uint32_t tabs) const override;
 
637
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
621
638
            Quantifier getQuantifier() const override { return Quantifier::E; }
622
639
            Path getPath() const override             { return Path::G; }
623
640
            uint32_t distance(DistanceContext& context) const override;
639
656
            Condition_ptr prepareForReachability(bool negated) const override;
640
657
            Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override;
641
658
            void toXML(std::ostream&, uint32_t tabs) const override;
 
659
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
642
660
            Quantifier getQuantifier() const override { return Quantifier::E; }
643
661
            Path getPath() const override             { return Path::F; }
644
662
            uint32_t distance(DistanceContext& context) const override;
658
676
            Condition_ptr prepareForReachability(bool negated) const override;
659
677
            Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override;
660
678
            void toXML(std::ostream&, uint32_t tabs) const override;
 
679
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
661
680
            Quantifier getQuantifier() const override { return Quantifier::A; }
662
681
            Path getPath() const override             { return Path::X; }
663
682
            uint32_t distance(DistanceContext& context) const override;
677
696
            Condition_ptr prepareForReachability(bool negated) const override;
678
697
            Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override;
679
698
            void toXML(std::ostream&, uint32_t tabs) const override;
 
699
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
680
700
            Quantifier getQuantifier() const override { return Quantifier::A; }
681
701
            Path getPath() const override             { return Path::G; }
682
702
            uint32_t distance(DistanceContext& context) const override;
696
716
            Condition_ptr prepareForReachability(bool negated) const override;
697
717
            Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override;
698
718
            void toXML(std::ostream&, uint32_t tabs) const override;
 
719
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
699
720
            Quantifier getQuantifier() const override { return Quantifier::A; }
700
721
            Path getPath() const override             { return Path::F; }
701
722
            uint32_t distance(DistanceContext& context) const override;
742
763
            void visit(Visitor&) const override;
743
764
            void visit(MutatingVisitor&) override;
744
765
            void toXML(std::ostream&, uint32_t tabs) const override;
 
766
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
745
767
            uint32_t distance(DistanceContext& context) const override { return (*this)[1]->distance(context); }
746
768
            Quantifier getQuantifier() const override { return Quantifier::EMPTY; }
747
769
        private:
763
785
            uint32_t distance(DistanceContext& context) const override;
764
786
            Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override;
765
787
            void toXML(std::ostream&, uint32_t tabs) const override;
 
788
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
766
789
 
767
790
        private:
768
791
            std::string op() const override;
777
800
            void visit(MutatingVisitor&) override;
778
801
            uint32_t distance(DistanceContext& context) const override;
779
802
            void toXML(std::ostream&, uint32_t tabs) const override;
 
803
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
780
804
            Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override;
781
805
            virtual bool isLoopSensitive() const override { return true; }
782
806
        private:
794
818
            std::string getName() const {
795
819
                return _name;
796
820
            }
 
821
            void toXML(std::ostream& out, uint32_t tabs) const override;
 
822
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
797
823
        protected:
798
824
            void _analyze(AnalysisContext& context) override;
799
825
 
810
836
            Condition_ptr pushNegation(negstat_t& stat, const EvaluationContext& context, bool nested, bool negated, bool initrw) override;
811
837
            void visit(Visitor&) const override;
812
838
            void visit(MutatingVisitor&) override;
813
 
 
 
839
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
814
840
            std::string getName() const {
815
841
                return _name;
816
842
            }
890
916
            void visit(Visitor&) const override;
891
917
            void visit(MutatingVisitor&) override;
892
918
            void toXML(std::ostream&, uint32_t tabs) const override;
 
919
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
893
920
            Quantifier getQuantifier() const override { return Quantifier::AND; }
894
921
            Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override;
895
922
            uint32_t distance(DistanceContext& context) const override;
914
941
            void visit(Visitor&) const override;
915
942
            void visit(MutatingVisitor&) override;
916
943
            void toXML(std::ostream&, uint32_t tabs) const override;
 
944
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
917
945
 
918
946
            Quantifier getQuantifier() const override { return Quantifier::OR; }
919
947
            Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override;
1001
1029
            CTLType getQueryType() const override { return CTLType::LOPERATOR; }
1002
1030
            Path getPath() const override         { return Path::pError; }
1003
1031
            virtual void toXML(std::ostream& stream, uint32_t tabs) const override;
 
1032
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
1004
1033
            Retval simplify(SimplificationContext& context) const override;
1005
1034
            Result evaluate(const EvaluationContext& context) override;
1006
1035
            Result evalAndSet(const EvaluationContext& context) override;
1090
1119
            using CompareCondition::CompareCondition;
1091
1120
            Retval simplify(SimplificationContext& context) const override;
1092
1121
            void toXML(std::ostream&, uint32_t tabs) const override;
 
1122
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
1093
1123
 
1094
1124
            uint32_t distance(DistanceContext& context) const override;
1095
1125
            Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override;
1110
1140
            void toTAPAALQuery(std::ostream&,TAPAALConditionExportContext& context) const override;
1111
1141
            Retval simplify(SimplificationContext& context) const override;
1112
1142
            void toXML(std::ostream&, uint32_t tabs) const override;
 
1143
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
1113
1144
 
1114
1145
 
1115
1146
            uint32_t distance(DistanceContext& context) const override;
1130
1161
            using CompareCondition::CompareCondition;
1131
1162
            Retval simplify(SimplificationContext& context) const override;
1132
1163
            void toXML(std::ostream&, uint32_t tabs) const override;
 
1164
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
1133
1165
 
1134
1166
            uint32_t distance(DistanceContext& context) const override;
1135
1167
            Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override;
1149
1181
            using CompareCondition::CompareCondition;
1150
1182
            Retval simplify(SimplificationContext& context) const override;
1151
1183
            void toXML(std::ostream&, uint32_t tabs) const override;
 
1184
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
1152
1185
 
1153
1186
            uint32_t distance(DistanceContext& context) const override;
1154
1187
            Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override;
1191
1224
            Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override;
1192
1225
            void toXML(std::ostream&, uint32_t tabs) const override;
1193
1226
            void toBinary(std::ostream&) const override;
 
1227
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
1194
1228
 
1195
1229
            Quantifier getQuantifier() const override { return Quantifier::EMPTY; }
1196
1230
            Path getPath() const override { return Path::pError; }
1223
1257
            Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override;
1224
1258
            void toXML(std::ostream&, uint32_t tabs) const override;
1225
1259
            void toBinary(std::ostream&) const override;
 
1260
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
1226
1261
 
1227
1262
            static Condition_ptr DEADLOCK;
1228
1263
            Quantifier getQuantifier() const override { return Quantifier::DEADLOCK; }
1355
1390
            Condition_ptr prepareForReachability(bool negated) const override;
1356
1391
            Condition_ptr pushNegation(negstat_t&, const EvaluationContext& context, bool nested, bool negated, bool initrw) override;
1357
1392
            void toXML(std::ostream&, uint32_t tabs) const override;
 
1393
            void toCompactXML(std::ostream&, uint32_t tabs, AnalysisContext& context) const override;
1358
1394
 
1359
1395
            Quantifier getQuantifier() const override { return Quantifier::UPPERBOUNDS; }
1360
1396
            Path getPath() const override { return Path::pError; }