55import java .util .stream .Collectors ;
66
77import liquidjava .diagnostics .TranslationTable ;
8+ import liquidjava .rj_language .ast .Var ;
9+ import liquidjava .rj_language .ast .prettyprinting .VariableFormatter ;
810import liquidjava .rj_language .opt .derivation_node .ValDerivationNode ;
911import liquidjava .smt .Counterexample ;
10- import liquidjava .utils .VariableFormatter ;
1112import spoon .reflect .cu .SourcePosition ;
1213
1314/**
@@ -23,10 +24,8 @@ public class RefinementError extends LJError {
2324
2425 public RefinementError (SourcePosition position , ValDerivationNode expected , ValDerivationNode found ,
2526 TranslationTable translationTable , Counterexample counterexample , String customMessage ) {
26- super ("Refinement Error" ,
27- String .format ("%s is not a subtype of %s" , VariableFormatter .formatText (found .getValue ().toString ()),
28- VariableFormatter .formatText (expected .getValue ().toString ())),
29- position , translationTable , customMessage );
27+ super ("Refinement Error" , String .format ("%s is not a subtype of %s" , found .getValue ().toDisplayString (),
28+ expected .getValue ().toDisplayString ()), position , translationTable , customMessage );
3029 this .expected = expected ;
3130 this .found = found ;
3231 this .counterexample = counterexample ;
@@ -50,11 +49,11 @@ public String getCounterExampleString() {
5049 // only include variables that appear in the found value
5150 .filter (a -> foundVarNames .contains (a .first ()))
5251 // format as "var == value"
53- .map (a -> VariableFormatter .formatVariable (a .first ()) + " == " + a .second ())
52+ .map (a -> VariableFormatter .format (a .first ()) + " == " + a .second ())
5453 // join with "&&"
5554 .collect (Collectors .joining (" && " ));
5655
57- String foundString = VariableFormatter . formatText ( found .getValue ().toString () );
56+ String foundString = found .getValue ().toDisplayString ( );
5857 if (counterexampleString .isEmpty () || counterexampleString .equals (foundString ))
5958 return null ;
6059
0 commit comments