@@ -68,6 +68,10 @@ public void setUp() {
6868 TacletForTests .parse ();
6969
7070 services = TacletForTests .services ();
71+ LocationVariable i = new LocationVariable (new ProgramElementName ("i" ),
72+ services .getJavaInfo ().getKeYJavaType ("int" ));
73+ services .getNamespaces ().programVariables ().add (i );
74+
7175 TB = services .getTermBuilder ();
7276
7377 all_left = (FindTaclet ) TacletForTests .getTaclet ("TestMatchTaclet_for_all" ).taclet ();
@@ -282,18 +286,17 @@ public void testConflict() {
282286 // test match of update terms
283287 @ Test
284288 public void testUpdateMatch () {
285- LocationVariable i = new LocationVariable (new ProgramElementName ("i" ),
286- services .getJavaInfo ().getKeYJavaType ("int" ));
287- services .getNamespaces ().programVariables ().add (i );
288- JTerm match = TacletForTests .parseTerm ("\\ <{}\\ >{i:=2}(\\ forall nat z; (q1(z)))" );
289+ JTerm match = TacletForTests .parseTerm ("\\ <{}\\ >{i:=2}(\\ forall nat z; (q1(z)))" , services ,
290+ services .getNamespaces ());
289291 match = match .sub (0 );
290292 assertNotNull (
291293 all_left .getMatcher ().matchFind (match , EMPTY_MATCHCONDITIONS , services ),
292294 "Instantiations should be found as updates can be ignored if "
293295 + "only the term that is matched has an update and the "
294296 + "template it is matched to has none." );
295297
296- JTerm match2 = TacletForTests .parseTerm ("\\ <{int i;}\\ >{i:=Z(2(#))} true" );
298+ JTerm match2 = TacletForTests .parseTerm ("\\ <{int i;}\\ >{i:=Z(2(#))} true" , services ,
299+ services .getNamespaces ());
297300 match2 = match2 .sub (0 );
298301 assertNotNull (assign_n .getMatcher ().matchFind (match2 , EMPTY_MATCHCONDITIONS ,
299302 services ), "Instantiations should be found." );
@@ -302,7 +305,7 @@ public void testUpdateMatch() {
302305
303306 @ Test
304307 public void testProgramMatchEmptyBlock () {
305- JTerm match = TacletForTests .parseTerm ("\\ <{ }\\ >true " );
308+ JTerm match = TacletForTests .parseTerm ("\\ <{ }\\ >true " , services );
306309 FindTaclet taclet = (FindTaclet ) TacletForTests .getTaclet ("empty_diamond" ).taclet ();
307310 MatchResultInfo mc =
308311 (taclet .getMatcher ().matchFind (match , EMPTY_MATCHCONDITIONS , services ));
@@ -317,7 +320,7 @@ public void testProgramMatchEmptyBlock() {
317320
318321 assertNotNull (mc );
319322
320- match = TacletForTests .parseTerm ("\\ <{ {int i = 0;} }\\ >true " );
323+ match = TacletForTests .parseTerm ("\\ <{ {int i = 0;} }\\ >true " , services );
321324 mc = (taclet .getMatcher ().matchFind (match , EMPTY_MATCHCONDITIONS ,
322325 services ));
323326
@@ -388,7 +391,8 @@ null, new LocationVariable(new ProgramElementName("testVar"),
388391 (taclet .getMatcher ().matchFind (match , EMPTY_MATCHCONDITIONS , services ));
389392 assertNotNull (mc , "Method-Frame should match" );
390393
391- JTerm termWithPV = TacletForTests .parseTerm ("\\ <{int i;}\\ >i=0" );
394+ JTerm termWithPV =
395+ TacletForTests .parseTerm ("\\ <{int i;}\\ >i=0" , services , services .getNamespaces ());
392396 match = TacletForTests .parseTerm ("\\ <{return 2;}\\ >true " );
393397 prg = (StatementBlock ) match .javaBlock ().program ();
394398 mframe = new MethodFrame ((IProgramVariable ) termWithPV .sub (0 ).sub (0 ).op (), ec , prg );
@@ -468,7 +472,8 @@ public void testInsequentStateRestriction() {
468472 FindTaclet unrestrictedTaclet =
469473 (FindTaclet ) TacletForTests .getTaclet ("testInsequentState_2" ).taclet ();
470474
471- JTerm match = TacletForTests .parseTerm ("{ i := 0 } (i = 0)" );
475+ JTerm match =
476+ TacletForTests .parseTerm ("{ i := 0 } (i = 0)" , services , services .getNamespaces ());
472477 MatchResultInfo mc = (restrictedTaclet .getMatcher ().matchFind (match ,
473478 EMPTY_MATCHCONDITIONS , services ));
474479 assertNull (mc , "Test inSequentState failed: matched on term with update prefix" );
@@ -477,7 +482,7 @@ public void testInsequentStateRestriction() {
477482 EMPTY_MATCHCONDITIONS , services ));
478483 assertNotNull (mc , "Test inSequentState failed: did not match on term with update prefix" );
479484
480- match = TacletForTests .parseTerm ("i = 0" );
485+ match = TacletForTests .parseTerm ("i = 0" , services , services . getNamespaces () );
481486 mc = (restrictedTaclet .getMatcher ().matchFind (match , EMPTY_MATCHCONDITIONS ,
482487 services ));
483488 assertNotNull (mc ,
0 commit comments