77import liquidjava .processor .VCImplication ;
88import liquidjava .rj_language .Predicate ;
99import liquidjava .rj_language .SimplifiedPredicate ;
10+ import liquidjava .rj_language .SimplifiedPredicate .Binder ;
1011import liquidjava .rj_language .ast .BinaryExpression ;
1112import liquidjava .rj_language .ast .Expression ;
1213import liquidjava .rj_language .ast .Var ;
@@ -81,7 +82,7 @@ private static VCImplication substitute(VCImplication implication, VCImplication
8182 */
8283 private static Predicate substituteRefinement (Predicate refinement , VCImplication source , Expression value ) {
8384 Expression active = activeExpression (refinement );
84- SimplifiedPredicate . Binder binder = new SimplifiedPredicate . Binder (source .getName (), source .getType ());
85+ Binder binder = new Binder (source .getName (), source .getType ());
8586 Expression substituted = active .substitute (new Var (binder .getName ()), value .clone ());
8687
8788 return new SimplifiedPredicate (new Predicate (substituted ), originPredicate (refinement ),
@@ -109,7 +110,7 @@ private static Predicate originPredicate(Predicate refinement) {
109110 /**
110111 * Builds the binder metadata after one substitution
111112 */
112- private static List <SimplifiedPredicate . Binder > bindersAfterSubstitution (Predicate refinement , Expression active ,
113+ private static List <Binder > bindersAfterSubstitution (Predicate refinement , Expression active ,
113114 SimplifiedPredicate .Binder binder ) {
114115 List <SimplifiedPredicate .Binder > binders = refinement instanceof SimplifiedPredicate previous
115116 ? new ArrayList <>(previous .getBinders ()) : new ArrayList <>();
@@ -158,14 +159,14 @@ private static Optional<Substitution> getSubstitution(VCImplication implication)
158159 /**
159160 * Checks whether an expression is a variable with a given name
160161 */
161- private static boolean isVar (Expression expression , String name ) {
162+ public static boolean isVar (Expression expression , String name ) {
162163 return expression instanceof Var var && name .equals (var .getName ());
163164 }
164165
165166 /**
166167 * Checks whether an expression contains a variable name
167168 */
168- private static boolean containsVariable (Expression expression , String name ) {
169+ public static boolean containsVariable (Expression expression , String name ) {
169170 List <String > names = new ArrayList <>();
170171 expression .getVariableNames (names );
171172 return names .contains (name );
@@ -174,7 +175,7 @@ private static boolean containsVariable(Expression expression, String name) {
174175 /**
175176 * Returns the expression used for matching and substitution
176177 */
177- private static Expression activeExpression (Predicate refinement ) {
178+ public static Expression activeExpression (Predicate refinement ) {
178179 if (refinement instanceof SimplifiedPredicate simplified )
179180 return simplified .getSimplifiedPredicate ().getExpression ().clone ();
180181 return refinement .getExpression ().clone ();
0 commit comments