Ejemplo n.º 1
0
        public HashSet <VariableType> GetIntegerVariables()
        {
            HashSet <VariableType> ret;

            switch (expression_type)
            {
            case SymbolicStringType.Repeat:
                ret = root.GetIntegerVariables();
                foreach (VariableType v in repeat.GetVariables())
                {
                    ret.Add(v);
                }
                break;

            case SymbolicStringType.Concat:
                ret = new HashSet <VariableType>();
                foreach (var sub in sub_strings)
                {
                    foreach (VariableType v in sub.GetIntegerVariables())
                    {
                        ret.Add(v);
                    }
                }
                break;

            case SymbolicStringType.Symbol:
                ret = new HashSet <VariableType>();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            return(ret);
        }
 public bool isUnary()
 {
     return(arithmetic_operand1.GetVariables().Count <= 1 && arithmetic_operand2.GetVariables().Count <= 1 && (arithmetic_operand1.isConstant() || arithmetic_operand2.isConstant()));
 }