diff --git a/fmi2/static-model/pom.xml b/fmi2/static-model/pom.xml
index 9cdd9e4f..bb456cde 100644
--- a/fmi2/static-model/pom.xml
+++ b/fmi2/static-model/pom.xml
@@ -9,6 +9,11 @@
org.into-cps.vdmcheck.fmi2
static-model
+
+
+ ${basedir}
+
+
.generated
diff --git a/fmi2/vdmcheck/src/main/java/annotations/ast/ASTOnFailAnnotation.java b/fmi2/vdmcheck/src/main/java/annotations/ast/ASTOnFailAnnotation.java
deleted file mode 100644
index 377a08e8..00000000
--- a/fmi2/vdmcheck/src/main/java/annotations/ast/ASTOnFailAnnotation.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/******************************************************************************
- *
- * Copyright (c) 2017-2022, INTO-CPS Association,
- * c/o Professor Peter Gorm Larsen, Department of Engineering
- * Finlandsgade 22, 8200 Aarhus N.
- *
- * This file is part of the INTO-CPS toolchain.
- *
- * MaestroCheck is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * MaestroCheck is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with MaestroCheck. If not, see .
- * SPDX-License-Identifier: GPL-3.0-or-later
- *
- ******************************************************************************/
-
-package annotations.ast;
-
-import com.fujitsu.vdmj.ast.annotations.ASTAnnotation;
-import com.fujitsu.vdmj.ast.lex.LexIdentifierToken;
-
-public class ASTOnFailAnnotation extends ASTAnnotation
-{
- private static final long serialVersionUID = 1L;
-
- public ASTOnFailAnnotation(LexIdentifierToken name)
- {
- super(name);
- }
-}
diff --git a/fmi2/vdmcheck/src/main/java/annotations/in/INOnFailAnnotation.java b/fmi2/vdmcheck/src/main/java/annotations/in/INOnFailAnnotation.java
deleted file mode 100644
index 7a141e76..00000000
--- a/fmi2/vdmcheck/src/main/java/annotations/in/INOnFailAnnotation.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/******************************************************************************
- *
- * Copyright (c) 2017-2022, INTO-CPS Association,
- * c/o Professor Peter Gorm Larsen, Department of Engineering
- * Finlandsgade 22, 8200 Aarhus N.
- *
- * This file is part of the INTO-CPS toolchain.
- *
- * MaestroCheck is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * MaestroCheck is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with MaestroCheck. If not, see .
- * SPDX-License-Identifier: GPL-3.0-or-later
- *
- ******************************************************************************/
-
-package annotations.in;
-
-import java.util.List;
-import java.util.Vector;
-
-import com.fujitsu.vdmj.in.annotations.INAnnotation;
-import com.fujitsu.vdmj.in.expressions.INExpression;
-import com.fujitsu.vdmj.in.expressions.INExpressionList;
-import com.fujitsu.vdmj.in.expressions.INIntegerLiteralExpression;
-import com.fujitsu.vdmj.in.expressions.INStringLiteralExpression;
-import com.fujitsu.vdmj.runtime.Context;
-import com.fujitsu.vdmj.runtime.ValueException;
-import com.fujitsu.vdmj.tc.lex.TCIdentifierToken;
-import com.fujitsu.vdmj.values.Value;
-
-import maestro.OnFailError;
-
-public class INOnFailAnnotation extends INAnnotation
-{
- private static final long serialVersionUID = 1L;
- private static List errorList = new Vector<>();
-
- public INOnFailAnnotation(TCIdentifierToken name, INExpressionList args)
- {
- super(name, args);
- }
-
- @Override
- public void inAfter(INExpression exp, Value rv, Context ctxt)
- {
- try
- {
- if (!rv.boolValue(ctxt)) // ONLY if we fail!
- {
- int errno = 0;
- int offset = 1; // By default, args(1) is the 1st
-
- if (args.get(0) instanceof INIntegerLiteralExpression)
- {
- INIntegerLiteralExpression num = (INIntegerLiteralExpression)args.get(0);
- errno = (int)num.value.value;
- offset = 2;
- }
-
- Object[] values = new Value[args.size() - offset];
-
- for (int p = offset; p < args.size(); p++)
- {
- values[p - offset] = args.get(p).eval(ctxt);
- }
-
- INStringLiteralExpression fmt = (INStringLiteralExpression)args.get(offset - 1);
- String format = fmt.value.value;
- String location = "";
-
- if (format.endsWith("$")) // Add @OnFail location to output
- {
- location = name.getLocation().toString();
- format = format.substring(0, format.length() - 1);
- }
-
- errorList.add(new OnFailError(errno, String.format(format + location, values)));
- }
- }
- catch (ValueException e)
- {
- // Doesn't happen
- }
- }
-
- public static void setErrorList(List errors)
- {
- errorList = errors;
- }
-}
diff --git a/fmi2/vdmcheck/src/main/java/annotations/tc/TCOnFailAnnotation.java b/fmi2/vdmcheck/src/main/java/annotations/tc/TCOnFailAnnotation.java
deleted file mode 100644
index 31de482a..00000000
--- a/fmi2/vdmcheck/src/main/java/annotations/tc/TCOnFailAnnotation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/******************************************************************************
- *
- * Copyright (c) 2017-2022, INTO-CPS Association,
- * c/o Professor Peter Gorm Larsen, Department of Engineering
- * Finlandsgade 22, 8200 Aarhus N.
- *
- * This file is part of the INTO-CPS toolchain.
- *
- * MaestroCheck is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * MaestroCheck is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with MaestroCheck. If not, see .
- * SPDX-License-Identifier: GPL-3.0-or-later
- *
- ******************************************************************************/
-
-package annotations.tc;
-
-import com.fujitsu.vdmj.tc.annotations.TCAnnotation;
-import com.fujitsu.vdmj.tc.expressions.TCExpression;
-import com.fujitsu.vdmj.tc.expressions.TCExpressionList;
-import com.fujitsu.vdmj.tc.lex.TCIdentifierToken;
-import com.fujitsu.vdmj.typechecker.Environment;
-import com.fujitsu.vdmj.typechecker.NameScope;
-
-public class TCOnFailAnnotation extends TCAnnotation
-{
- private static final long serialVersionUID = 1L;
-
- public TCOnFailAnnotation(TCIdentifierToken name, TCExpressionList args)
- {
- super(name, args);
- }
-
- @Override
- public void tcBefore(TCExpression exp, Environment env, NameScope scope)
- {
- for (TCExpression arg: args)
- {
- arg.typeCheck(env, null, scope, null); // Just checks scope
- }
- }
-}
diff --git a/fmi2/vdmcheck/src/main/java/com/fujitsu/vdmj/mapper/ClassMapper.java b/fmi2/vdmcheck/src/main/java/com/fujitsu/vdmj/mapper/ClassMapper.java
new file mode 100644
index 00000000..388e7935
--- /dev/null
+++ b/fmi2/vdmcheck/src/main/java/com/fujitsu/vdmj/mapper/ClassMapper.java
@@ -0,0 +1,653 @@
+/*******************************************************************************
+ *
+ * Copyright (c) 2016 Fujitsu Services Ltd.
+ *
+ * Author: Nick Battle
+ *
+ * This file is part of VDMJ.
+ *
+ * VDMJ is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * VDMJ is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with VDMJ. If not, see .
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *
+ ******************************************************************************/
+
+package com.fujitsu.vdmj.mapper;
+/*
+ * This is an older version of the ClassLoader in VDMJ which permits the override load behaviour
+ * We need this as we dont want the interpreter to print to the console but to a list
+ * */
+
+import com.fujitsu.vdmj.config.Properties;
+
+import java.io.File;
+import java.io.InputStream;
+import java.lang.reflect.*;
+import java.net.URL;
+import java.util.*;
+
+/**
+ * A class to map classes and extend trees of objects.
+ */
+public class ClassMapper {
+ /**
+ * The mappers that have already been loaded, indexed by resource name
+ */
+ private final static Map mappers = new HashMap();
+
+ /**
+ * These caches hold the object references converted so far, and keep a stack of the objects that are currently being processed.
+ */
+ private final Stack