protected < R > R liftRegularChildBinding ( ConstructionNode selectedChildConstructionNode , int selectedChildPosition , IQTree selectedGrandChild , ImmutableList < IQTree > children , ImmutableSet < Variable > nonLiftableVariables , Optional < ImmutableExpression > initialJoiningCondition , VariableGenerator variableGenerator , LiftConverter < R > liftConverter ) throws UnsatisfiableConditionException { ImmutableSubstitution < ImmutableTerm > selectedChildSubstitution = selectedChildConstructionNode . getSubstitution ( ) ; ImmutableSubstitution < NonFunctionalTerm > downPropagableFragment = selectedChildSubstitution . getNonFunctionalTermFragment ( ) ; ImmutableSubstitution < ImmutableFunctionalTerm > nonDownPropagableFragment = selectedChildSubstitution . getFunctionalTermFragment ( ) ; ImmutableSet < Variable > otherChildrenVariables = IntStream . range ( 0 , children . size ( ) ) . filter ( i -> i != selectedChildPosition ) . boxed ( ) . map ( children :: get ) . flatMap ( iq -> iq . getVariables ( ) . stream ( ) ) . collect ( ImmutableCollectors . toSet ( ) ) ; InjectiveVar2VarSubstitution freshRenaming = computeOtherChildrenRenaming ( nonDownPropagableFragment , otherChildrenVariables , variableGenerator ) ; ExpressionAndSubstitution expressionResults = simplifyCondition ( computeNonOptimizedCondition ( initialJoiningCondition , selectedChildSubstitution , freshRenaming ) , nonLiftableVariables ) ; Optional < ImmutableExpression > newCondition = expressionResults . optionalExpression ; ImmutableSubstitution < ImmutableTerm > ascendingSubstitution = expressionResults . substitution . composeWith ( selectedChildSubstitution ) ; ImmutableSubstitution < NonFunctionalTerm > descendingSubstitution = expressionResults . substitution . composeWith2 ( freshRenaming ) . composeWith2 ( downPropagableFragment ) ; return liftConverter . convert ( children , selectedGrandChild , selectedChildPosition , newCondition , ascendingSubstitution , descendingSubstitution ) ; }
For children of a commutative join or for the left child of a LJ