Example #1
0
        public override IGate Invert()
        {
            var sc = new StateCondition(Variable);
            sc.SetPreStates(Variable.Type.GetExcluding(new int[] { StateIndex }));
            var r = sc.Decompose(ConditionMode.Pre);

            //Gate.TraceLabel(this, r, "invert");

            return r;
        }
Example #2
0
        public override IGate Invert()
        {
            var sc = new StateCondition(Variable);

            sc.SetPreStates(Variable.Type.GetExcluding(new int[] { StateIndex }));
            var r = sc.Decompose(ConditionMode.Pre);

            //Gate.TraceLabel(this, r, "invert");

            return(r);
        }
Example #3
0
        public void SMG_04_05_Simplyify()
        {
            var sm = new StateMachine();
            var stype = sm.AddSimpleType("S");
            stype.AddStateNames(new[] { "A", "B", "C", "D", "X" });
            var v = sm.AddVariable("v", stype);
            var u = sm.AddVariable("u", stype);

            // A + B
            var c1 = new StateCondition(v);
            c1.SetPreStates(new[] { 0, 1 });

            // D
            var c2 = new StateCondition(v);
            c2.SetPreStates(new[] { 3 });

            // A
            var c3 = new StateCondition(v);
            c2.SetPreStates(new[] { 0 });

            var c1dc = Gate.ComposeAND(Gate.Invert(c1.Decompose(ConditionMode.Pre)), Gate.Invert(c2.Decompose(ConditionMode.Pre)));

            Trace("1 === {0}", c1dc);

            return;
        }