コード例 #1
0
    public override Operator toExplicit()
    {
        BinaryOperator o = new OperatorOr();

        o.setLeftOperand(m_left.toExplicit());
        o.setRightOperand(m_left.toExplicit());

        return o;
    }
コード例 #2
0
    public override Operator toExplicit()
    {
        if (m_domain == null || m_domain.Count == 0)
        {
            return null;
        }

        BinaryOperator bo = new OperatorOr();
        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 OperatorOr();

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

        return bo;
    }