// $Id: Implication.java,v 1.6 2004/02/27 16:30:00 m31 Exp $
//
// This file is part of the program suite "Principia Mathematica II"
// which is a working prototype for the main project:
// "Hilbert II" - http://www.qedeq.org
//
// Copyright 2001-2004  Michael Meyling <mime@qedeq.org>.
//
// "Principia Mathematica II" is free software; you can redistribute
// it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

package com.meyling.principia.logic.basic;


import com.meyling.principia.argument.Argument;
import com.meyling.principia.argument.ArgumentException;


/**
 * Implication of formulas. Implementation of the locigal &quot;if&quot;.
 *
 * @version $Revision: 1.6 $
 * @author  Michael Meyling
 */
public class Implication extends LogicalOperatorWithTwoFormulas {


    /**
     * Constructs a logical implication.
     *
     * @param   arguments     formulas to operate on
     * @throws  ArgumentException    if there are not exactly two
     *          arguments that are instances of {@link Formula} or
     *          if the is a subject variable that would exist
     *          bound and unbound in the resulting formula
     *
     */
    public Implication(final Argument[] arguments) throws ArgumentException {
        super (arguments);
    }


    /**
     * Constructs a logical implication.
     *
     * @param   formula1    first formula
     * @param   formula2    second formula
     * @throws  ArgumentException    if the is a subject variable
     *          that would exist bound and unbound in the resulting formula
     *
     */
    public Implication(final Formula formula1, final Formula formula2)
            throws ArgumentException {
        super(formula1, formula2);
    }


    /** @inherited */
    public final Argument create(final Argument[] arguments)
            throws ArgumentException {
        return new Implication(arguments);
    }


    /** @inherited */
    public final String toString() {
        return "(" + getArgument(0).toString() + " => "
            + getArgument(1).toString() + ")";
    }


}
