protected AscendingSubstitutionNormalization normalizeAscendingSubstitution ( ImmutableSubstitution < ImmutableTerm > ascendingSubstitution , ImmutableSet < Variable > projectedVariables ) { Var2VarSubstitution downRenamingSubstitution = substitutionFactory . getVar2VarSubstitution ( ascendingSubstitution . getImmutableMap ( ) . entrySet ( ) . stream ( ) . filter ( e -> e . getValue ( ) instanceof Variable ) . map ( e -> Maps . immutableEntry ( e . getKey ( ) , ( Variable ) e . getValue ( ) ) ) . filter ( e -> ! projectedVariables . contains ( e . getValue ( ) ) ) . collect ( ImmutableCollectors . toMap ( Map . Entry :: getValue , Map . Entry :: getKey , ( v1 , v2 ) -> v1 ) ) ) ; ImmutableSubstitution < ImmutableTerm > newAscendingSubstitution = downRenamingSubstitution . composeWith ( ascendingSubstitution ) . reduceDomainToIntersectionWith ( projectedVariables ) . normalizeValues ( ) ; return new AscendingSubstitutionNormalization ( newAscendingSubstitution , downRenamingSubstitution , projectedVariables ) ; }
Prevents creating construction nodes out of ascending substitutions