Ejemplo n.º 1
0
 public ConditionalBranchInstruction(uint label, IVariable left, BranchOperation operation, IInmediateValue right, uint target)
     : base(label, target)
 {
     this.Operation    = operation;
     this.LeftOperand  = left;
     this.RightOperand = right;
 }
Ejemplo n.º 2
0
            public static BoogieMethod GetBinaryMethod(BranchOperation op)
            {
                BoogieMethod method = null;

                switch (op)
                {
                case BranchOperation.Eq: method = BoogieMethod.StringEquality; break;

                case BranchOperation.Neq: method = BoogieMethod.StringInequality; break;
                }
                Contract.Assert(method != null);
                return(method);
            }
Ejemplo n.º 3
0
        /// <summary>
        /// We use a branch instruction.
        /// </summary>
        public T Branch <T>([NotNull] Boolx1 value, [NotNull] T isTrue, [NotNull] T isFalse) where T : PinBinder
        {
            if (isTrue.Generator != isFalse.Generator ||
                isTrue.Generator != value.Generator || isTrue.Generator != this)
            {
                throw new ArgumentException("All values must have the same generator.");
            }

            BranchOperation op = new BranchOperation();

            op.BindInputs(value.Pin, isTrue.Pin, isFalse.Pin);

            return((T)CreateFrom(op.Outputs[0]));
        }