package prolog.implementation;

import prolog.model.*;

/**
 * Query is a fact implementation with overriding
 * the toString method.
 *
 * A query has e.g. the following form: ?-name(X,Y).
 *
 */
public class Query extends Fact
{
	/**
	 * constructor
	 */
	public Query( int name )
	{
		super( name );
	}

	/**
	 * constructor
	 */
	public Query( IFact f )
	{
		super( f.getName(), f.getRelation() );
	}

	/**
	 * constructor
	 */
	public Query( int name, IRelation r )
	{
		super( name, r );
	}

	/**
	 * returns a string representation of this class
	 */
	public String toString()
	{
		return toString( null );
	}

	/**
	 * returns a string representation of this class
	 * with decodec symbols.
	 */
	public String toString( ISymbolTable table )
	{
		return
			"?-" + super.toString( table );
	}
}
