Exemplo n.º 1
0
    public override Operator toExplicit()
    {
        if (m_domain == null || m_domain.Count == 0)
        {
            return null;
        }

        BinaryOperator bo = new BinaryOperator();
        bool first = true;

        foreach (Atom a in m_domain)
        {
            Operator o = m_operand.evaluate(m_quantifiedVariable, a);

            if (m_domain.Count == 1)
            {
                return o;
            }

            if (first)
            {
                first = false;
                bo.setLeftOperand(o);

                continue;
            }

            if (bo.getRightOperand() == null)
            {
                bo.setRightOperand(o);
            }

            else
            {
                BinaryOperator newbo = new OperatorAnd();

                newbo.setLeftOperand(bo);
                newbo.setRightOperand(o);
                bo = newbo;
            }
        }

        return bo;
    }