Пример #1
0
        public void Anon()
        {
            TestDriver        currentMachine = this;
            PMachineValue     m        = null;
            PMachineValue     TMP_tmp0 = null;
            PMachineValue     TMP_tmp1 = null;
            PMachineValue     TMP_tmp2 = null;
            PMachineValue     TMP_tmp3 = null;
            PMachineValue     TMP_tmp4 = null;
            PMachineValue     TMP_tmp5 = null;
            IEventWithPayload TMP_tmp6 = null;
            PMachineValue     TMP_tmp7 = null;
            PMachineValue     TMP_tmp8 = null;
            PMachineValue     TMP_tmp9 = null;

            TMP_tmp0        = currentMachine.CreateInterface <I_ReliableStorageMachine>(currentMachine);
            reliableStorage = TMP_tmp0;
            TMP_tmp1        = currentMachine.CreateInterface <I_ServiceMachine>(currentMachine);
            service         = TMP_tmp1;
            TMP_tmp2        = ((PMachineValue)((IPrtValue)service)?.Clone());
            TMP_tmp3        = ((PMachineValue)((IPrtValue)reliableStorage)?.Clone());
            TMP_tmp4        = currentMachine.CreateInterface <I_FaultTolerantMachine>(currentMachine, TMP_tmp2);
            m        = (PMachineValue)TMP_tmp4;
            TMP_tmp5 = ((PMachineValue)((IPrtValue)m)?.Clone());
            TMP_tmp6 = new PHalt(null);
            currentMachine.SendEvent(currentMachine, TMP_tmp5, (Event)TMP_tmp6);
            TMP_tmp7 = ((PMachineValue)((IPrtValue)service)?.Clone());
            TMP_tmp8 = ((PMachineValue)((IPrtValue)reliableStorage)?.Clone());
            TMP_tmp9 = currentMachine.CreateInterface <I_FaultTolerantMachine>(currentMachine, TMP_tmp7);
            m        = (PMachineValue)TMP_tmp9;
        }
Пример #2
0
        public async Task PossiblyRaiseHalt()
        {
            FaultTolerantMachine currentMachine = this;
            IEventWithPayload    TMP_tmp0_4     = null;
            var PGEN_recvEvent_1 = await currentMachine.ReceiveEvent(typeof(PHalt), typeof(DefaultEvent));

            switch (PGEN_recvEvent_1)
            {
            case PHalt PGEN_evt_1: {
                TMP_tmp0_4 = new PHalt(null);
                currentMachine.RaiseEvent(currentMachine, (Event)TMP_tmp0_4);
                throw new PUnreachableCodeException();
            } break;

            case DefaultEvent PGEN_evt_2: {
            } break;
            }
        }