package project.Entrytypes; import java.util.*; import org.overture.codegen.runtime.*; import org.overture.codegen.vdm2jml.runtime.*; @SuppressWarnings("all") //@ nullable_by_default final public class R4 implements Record { public Number x; //@ public instance invariant project.Entry.invChecksOn ==> inv_R4(x); public R4(final Number _x) { //@ assert Utils.is_int(_x); x = _x; //@ assert Utils.is_int(x); } /*@ pure @*/ public boolean equals(final Object obj) { if (!(obj instanceof project.Entrytypes.R4)) { return false; } project.Entrytypes.R4 other = ((project.Entrytypes.R4) obj); return Utils.equals(x, other.x); } /*@ pure @*/ public int hashCode() { return Utils.hashCode(x); } /*@ pure @*/ public project.Entrytypes.R4 copy() { return new project.Entrytypes.R4(x); } /*@ pure @*/ public String toString() { return "mk_Entry`R4" + Utils.formatFields(x); } /*@ pure @*/ public Number get_x() { Number ret_6 = x; //@ assert project.Entry.invChecksOn ==> (Utils.is_int(ret_6)); return ret_6; } public void set_x(final Number _x) { //@ assert project.Entry.invChecksOn ==> (Utils.is_int(_x)); x = _x; //@ assert project.Entry.invChecksOn ==> (Utils.is_int(x)); } /*@ pure @*/ public Boolean valid() { return true; } /*@ pure @*/ /*@ helper @*/ public static Boolean inv_R4(final Number _x) { return !(Utils.equals(_x, 4L)); } /*@ pure @*/ /*@ helper @*/ public static Boolean inv_Entry_T3(final Object check_t3) { Object t3 = ((Object) check_t3); Boolean andResult_1 = false; Boolean orResult_1 = false; if (!(Utils.is_(t3, project.Entrytypes.R3.class))) { orResult_1 = true; } else { project.Entrytypes.R4 apply_9 = null; if (t3 instanceof project.Entrytypes.R3) { apply_9 = ((project.Entrytypes.R3) t3).get_r4(); } else { throw new RuntimeException("Missing member: r4"); } orResult_1 = !(Utils.equals(apply_9.get_x(), 10L)); } if (orResult_1) { Boolean orResult_2 = false; if (!(Utils.is_(t3, project.Entrytypes.X.class))) { orResult_2 = true; } else { Boolean apply_10 = null; if (t3 instanceof project.Entrytypes.X) { apply_10 = ((project.Entrytypes.X) t3).get_b(); } else { throw new RuntimeException("Missing member: b"); } orResult_2 = apply_10; } if (orResult_2) { andResult_1 = true; } } return andResult_1; } }