Commit 08f0cbd
HOTFIX avoid caching extra predicates, only simplify term during rewrite (#4103)
The change in #3953 introduced additional arguments to evaluation
functions which allow callers to supply some "known true" predicates for
the simplification and evaluation. However, doing so means that the
cache will get populated with associations that might only be true if
this known truth does not change.
The case in point was a predicate being cached as "true" because of an
earlier evaluation, and then _removed_ from the path condition (see
added integration test).
This change
* refactors `checkConstraint` functions to fix the pattern constraints
* skips the cache update if any additional "known truth" arguments were
supplied to `checkConstraint`, and
* runs internal computations that manipulate the predicates with a fresh
empty cache.
Furthermore, to avoid a significant performance penalty, we
* simplify the pattern constraints once before starting to rewrite
* only simplify the pattern _term_ during rewriting
- the pattern constraints are already evaluated and stay the same
- if a new constraint is added (by way of an `ensures`), this constraint
is evaluated before adding it
* At the end of the rewrite, we still simplify everything again
(including the entire path condition).
We are not using the SMT solver to detect a vacuous state at the start,
though, could add that separately if desired. At the moment, the
behaviour is largely the same as before (integration test expectations
identical except for some evaluation in vacuous states).
---------
Co-authored-by: github-actions <[email protected]>1 parent d3c36c1 commit 08f0cbd
File tree
17 files changed
+194759
-218
lines changed- booster
- library/Booster/Pattern
- test/rpc-integration
- resources
- test-log-simplify-json
- test-retain-condition-cache
- test-substitutions
- test-vacuous
- unit-tests/Test/Booster/Pattern
- scripts
17 files changed
+194759
-218
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
| 336 | + | |
336 | 337 | | |
337 | 338 | | |
338 | 339 | | |
| |||
423 | 424 | | |
424 | 425 | | |
425 | 426 | | |
426 | | - | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
427 | 431 | | |
428 | 432 | | |
429 | 433 | | |
430 | 434 | | |
431 | 435 | | |
432 | 436 | | |
| 437 | + | |
433 | 438 | | |
434 | 439 | | |
435 | 440 | | |
436 | | - | |
437 | | - | |
438 | | - | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
439 | 445 | | |
440 | 446 | | |
441 | 447 | | |
| |||
447 | 453 | | |
448 | 454 | | |
449 | 455 | | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
450 | 459 | | |
451 | 460 | | |
452 | 461 | | |
| |||
510 | 519 | | |
511 | 520 | | |
512 | 521 | | |
| 522 | + | |
513 | 523 | | |
514 | 524 | | |
515 | | - | |
516 | | - | |
517 | | - | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
518 | 528 | | |
519 | | - | |
| 529 | + | |
520 | 530 | | |
521 | 531 | | |
522 | 532 | | |
523 | 533 | | |
524 | 534 | | |
525 | 535 | | |
526 | | - | |
527 | 536 | | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
542 | 544 | | |
543 | 545 | | |
544 | 546 | | |
| |||
1075 | 1077 | | |
1076 | 1078 | | |
1077 | 1079 | | |
1078 | | - | |
1079 | | - | |
1080 | | - | |
| 1080 | + | |
| 1081 | + | |
1081 | 1082 | | |
1082 | 1083 | | |
1083 | 1084 | | |
| |||
1088 | 1089 | | |
1089 | 1090 | | |
1090 | 1091 | | |
1091 | | - | |
1092 | | - | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
1093 | 1097 | | |
1094 | 1098 | | |
1095 | 1099 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
154 | | - | |
| 153 | + | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
| 61 | + | |
60 | 62 | | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| |||
516 | 519 | | |
517 | 520 | | |
518 | 521 | | |
519 | | - | |
520 | | - | |
521 | | - | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
522 | 532 | | |
523 | 533 | | |
524 | 534 | | |
| |||
537 | 547 | | |
538 | 548 | | |
539 | 549 | | |
540 | | - | |
| 550 | + | |
541 | 551 | | |
542 | | - | |
543 | | - | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
544 | 555 | | |
545 | | - | |
546 | | - | |
547 | | - | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
548 | 560 | | |
549 | 561 | | |
550 | 562 | | |
| |||
559 | 571 | | |
560 | 572 | | |
561 | 573 | | |
562 | | - | |
563 | 574 | | |
564 | 575 | | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
| 576 | + | |
570 | 577 | | |
571 | 578 | | |
572 | 579 | | |
| |||
575 | 582 | | |
576 | 583 | | |
577 | 584 | | |
578 | | - | |
| 585 | + | |
579 | 586 | | |
580 | 587 | | |
581 | 588 | | |
582 | 589 | | |
583 | 590 | | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
| 591 | + | |
589 | 592 | | |
590 | 593 | | |
591 | 594 | | |
| |||
614 | 617 | | |
615 | 618 | | |
616 | 619 | | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | | - | |
621 | 620 | | |
622 | 621 | | |
623 | 622 | | |
624 | 623 | | |
625 | 624 | | |
626 | 625 | | |
627 | | - | |
| 626 | + | |
| 627 | + | |
628 | 628 | | |
629 | 629 | | |
630 | 630 | | |
| |||
672 | 672 | | |
673 | 673 | | |
674 | 674 | | |
675 | | - | |
| 675 | + | |
676 | 676 | | |
677 | 677 | | |
678 | 678 | | |
| |||
1001 | 1001 | | |
1002 | 1002 | | |
1003 | 1003 | | |
1004 | | - | |
1005 | | - | |
1006 | | - | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
1007 | 1014 | | |
1008 | 1015 | | |
1009 | 1016 | | |
| |||
1034 | 1041 | | |
1035 | 1042 | | |
1036 | 1043 | | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
1037 | 1065 | | |
1038 | 1066 | | |
1039 | 1067 | | |
| |||
1228 | 1256 | | |
1229 | 1257 | | |
1230 | 1258 | | |
1231 | | - | |
| 1259 | + | |
1232 | 1260 | | |
1233 | 1261 | | |
1234 | 1262 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments