@@ -38,13 +38,8 @@ public VCChecker() {
3838 pathVariables = new Stack <>();
3939 }
4040
41- public void processSubtyping (Predicate expectedType , List <GhostState > list , CtElement element , Factory f )
42- throws LJError {
43- processSubtyping (expectedType , list , element , f , null );
44- }
45-
4641 public void processSubtyping (Predicate expectedType , List <GhostState > list , CtElement element , Factory f ,
47- String customMessage ) throws LJError {
42+ SourcePosition declarationPosition , String customMessage ) throws LJError {
4843 List <RefinedVariable > lrv = new ArrayList <>(), mainVars = new ArrayList <>();
4944 gatherVariables (expectedType , lrv , mainVars );
5045 if (expectedType .isBooleanTrue ())
@@ -82,8 +77,8 @@ public void processSubtyping(Predicate expectedType, List<GhostState> list, CtEl
8277 }
8378 DebugLog .smtResult (result );
8479 if (result .isError ()) {
85- throw new RefinementError (element .getPosition (), expectedType , implBeforeChange . simplify (), map ,
86- result .getCounterexample (), customMessage );
80+ throw new RefinementError (element .getPosition (), declarationPosition , expectedType ,
81+ implBeforeChange . simplify (), map , result .getCounterexample (), customMessage );
8782 }
8883 }
8984
@@ -99,10 +94,11 @@ public void processSubtyping(Predicate expectedType, List<GhostState> list, CtEl
9994 * @throws LJError
10095 */
10196 public void processSubtyping (Predicate type , Predicate expectedType , List <GhostState > list , CtElement element ,
102- Factory f ) throws LJError {
97+ SourcePosition declarationPosition , Factory f ) throws LJError {
10398 SMTResult result = verifySMTSubtypeStates (type , expectedType , list , element .getPosition (), f );
10499 if (result .isError ())
105- throwRefinementError (element .getPosition (), expectedType , type , result .getCounterexample (), null );
100+ throwRefinementError (element .getPosition (), declarationPosition , expectedType , type ,
101+ result .getCounterexample (), null );
106102 }
107103
108104 /**
@@ -407,18 +403,20 @@ private VCImplication buildPremiseChain(TranslationTable map, Predicate... predi
407403 return joinPredicates (predicates [0 ], mainVars , lrv , map );
408404 }
409405
410- protected void throwRefinementError (SourcePosition position , Predicate expected , Predicate found ,
411- Counterexample counterexample , String customMessage ) throws RefinementError {
406+ protected void throwRefinementError (SourcePosition position , SourcePosition declarationPosition , Predicate expected ,
407+ Predicate found , Counterexample counterexample , String customMessage ) throws RefinementError {
412408 TranslationTable map = new TranslationTable ();
413409 VCImplication premises = buildPremiseChain (map , expected , found );
414- throw new RefinementError (position , expected , premises .simplify (), map , counterexample , customMessage );
410+ throw new RefinementError (position , declarationPosition , expected , premises .simplify (), map , counterexample ,
411+ customMessage );
415412 }
416413
417- protected void throwStateRefinementError (SourcePosition position , Predicate found , Predicate expected ,
418- String customMessage ) throws StateRefinementError {
414+ protected void throwStateRefinementError (SourcePosition position , SourcePosition declarationPosition ,
415+ Predicate found , Predicate expected , String customMessage ) throws StateRefinementError {
419416 TranslationTable map = new TranslationTable ();
420417 VCImplication foundState = buildPremiseChain (map , expected , found );
421- throw new StateRefinementError (position , expected , foundState .simplify (), map , customMessage );
418+ throw new StateRefinementError (position , declarationPosition , expected , foundState .simplify (), map ,
419+ customMessage );
422420 }
423421
424422 protected void throwStateConflictError (SourcePosition position , Predicate expected ) throws StateConflictError {
0 commit comments