@@ -677,6 +677,27 @@ module MakeModelGenerator<
677
677
)
678
678
}
679
679
680
+ private string getReversedHash ( PropagateContentFlow:: AccessPath ap ) {
681
+ result = concat ( int i | | getSyntheticName ( ap .getAtIndex ( i ) ) , "" order by i desc )
682
+ }
683
+
684
+ private string getHash ( PropagateContentFlow:: AccessPath ap ) {
685
+ result = concat ( int i | | getSyntheticName ( ap .getAtIndex ( i ) ) , "" order by i )
686
+ }
687
+
688
+ /**
689
+ * Gets all access paths that contains the synthetic fields
690
+ * from `ap` in reverse order (if `ap` contains at least one synthetic field).
691
+ * These are the possible candidates for synthetic path continuations.
692
+ */
693
+ private PropagateContentFlow:: AccessPath getSyntheticPathCandidate (
694
+ PropagateContentFlow:: AccessPath ap
695
+ ) {
696
+ hasSyntheticContent ( ap ) and
697
+ hasSyntheticContent ( result ) and
698
+ getHash ( ap ) = getReversedHash ( result )
699
+ }
700
+
680
701
/**
681
702
* A module containing predicates for validating access paths containing content sets
682
703
* that translates into synthetic fields, when used for generated summary models.
@@ -740,7 +761,7 @@ module MakeModelGenerator<
740
761
exists ( PropagateContentFlow:: AccessPath mid , Type midType |
741
762
hasSyntheticContent ( mid ) and
742
763
step ( t , read , midType , mid ) and
743
- reachesSynthExit ( midType , mid . reverse ( ) )
764
+ reachesSynthExit ( midType , getSyntheticPathCandidate ( mid ) )
744
765
)
745
766
}
746
767
@@ -756,7 +777,7 @@ module MakeModelGenerator<
756
777
exists ( PropagateContentFlow:: AccessPath mid , Type midType |
757
778
hasSyntheticContent ( mid ) and
758
779
step ( midType , mid , t , store ) and
759
- synthEntryReaches ( midType , mid . reverse ( ) )
780
+ synthEntryReaches ( midType , getSyntheticPathCandidate ( mid ) )
760
781
)
761
782
}
762
783
@@ -785,14 +806,15 @@ module MakeModelGenerator<
785
806
Type t1 , PropagateContentFlow:: AccessPath read , Type t2 ,
786
807
PropagateContentFlow:: AccessPath store
787
808
) {
788
- synthPathEntry ( t1 , read , t2 , store ) and reachesSynthExit ( t2 , store .reverse ( ) )
809
+ synthPathEntry ( t1 , read , t2 , store ) and
810
+ reachesSynthExit ( t2 , getSyntheticPathCandidate ( store ) )
789
811
or
790
- exists ( PropagateContentFlow:: AccessPath store0 | store0 . reverse ( ) = read |
812
+ exists ( PropagateContentFlow:: AccessPath store0 | getSyntheticPathCandidate ( store0 ) = read |
791
813
synthEntryReaches ( t1 , store0 ) and synthPathExit ( t1 , read , t2 , store )
792
814
or
793
815
synthEntryReaches ( t1 , store0 ) and
794
816
step ( t1 , read , t2 , store ) and
795
- reachesSynthExit ( t2 , store . reverse ( ) )
817
+ reachesSynthExit ( t2 , getSyntheticPathCandidate ( store ) )
796
818
)
797
819
}
798
820
}
0 commit comments