Skip to content
Snippets Groups Projects
Commit f907e152 authored by hansen's avatar hansen
Browse files

Do not clone nodes, because the clones do not contain all required information (type etc.)

parent b3bd895a
Branches
No related tags found
No related merge requests found
......@@ -50,14 +50,15 @@ public class Typechecker extends DepthFirstAdapter implements ITypechecker {
this.referenceTable = machineContext.getReferences();
}
public Typechecker(MachineContext c) {
public Typechecker(MachineContext context) {
this.types = new Hashtable<Node, BType>();
this.referenceTable = c.getReferences();
this.machineContext = c;
c.getTree().apply(this);
this.referenceTable = context.getReferences();
this.machineContext = context;
context.getTree().apply(this);
checkLTLFormulas();
checkConstantsSetup();
}
private void checkLTLFormulas() {
......
......@@ -249,7 +249,7 @@ public class Generator extends DepthFirstAdapter {
AExpressionDefinitionDefinition exprDef = new AExpressionDefinitionDefinition(
con.getIdentifier().get(0), new LinkedList<PExpression>(),
(PExpression) value.clone());
(PExpression) value);//.clone());
machineContext.addReference(exprDef, con);
this.tlaModule.addToAllDefinitions(exprDef);
......
......@@ -34,6 +34,14 @@ public class SpecialTest {
}
@Test
public void testConstantSetupFile2() throws Exception {
String[] a = new String[] {
"./src/test/resources/special/ConstantsSetup2.mch",
"-constantsSetup", "a = {(1,TRUE)}" };
assertEquals(NoError, test(a));
}
@Test
public void testTraceFile() throws Exception {
String[] a = new String[] {
......
......@@ -7,7 +7,7 @@ public class TLC4BTester {
public static void main(String[] args) throws Exception {
System.setProperty("apple.awt.UIElement", "true"); // avoiding pop up windows
TLC4B.test(args,true);
TLC4B.test(args,false);
}
}
MACHINE ConstantSetup2
CONSTANTS a
PROPERTIES a : 1..1 --> {TRUE}
VARIABLES x, y
INVARIANT
x : BOOL & y : NAT
INITIALISATION x := a(1) || y := 1
OPERATIONS
foo = skip
END
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment