package prolog.model;

/**
 * IProgramBuilder is a kind of class factory.
 * It is required to be able to use different
 * implementation of classed in the program.
 *
 * it is also usefull to seperate packages from
 * each other. so a minimal set of import references
 * into another package is required.
 *
 * !!! be ware of class cast exceptions !!!
 */
public interface IProgramBuilder
{
	/**
	 * returns a implementation of a IStatementMap
	 */
	public IStatementMap createStatementMap();

	/**
	 * returns a implementation of a IQueryList
	 */
	public IQueryList createQueryList();

	/**
	 * returns a implementation of a IProgram
	 */
	public IProgram createProgram();

	/**
	 * returns a implementation of a IFactDb
	 */
	public IFactDb createFactDb();

	/**
	 * returns a implementation of a IFactList
	 */
	public IFactList createFactList( int name, int colCount );

	/**
	 * returns a implementation of a IRelation
	 */
	public IRelation createRelation();

	/**
	 * returns a implementation of a AndStatement
	 */
	public IFact createAndStatement( IFact f );

	/**
	 * returns a implementation of a AndStatement
	 */
	public IFact createAndStatement( int name );

	/**
	 * returns a implementation of a ConstraintStatement
	 */
	public IFact createConstraintStatement( int name );

	/**
	 * returns a implementation of a ConstraintStatement
	 */
	public IFact createConstraintStatement( int name, IRelation relation );

	/**
	 * returns a implementation of a MatchingStatement
	 */
	public IFact createMatchingStatement( int name );

	/**
	 * returns a implementation of a MatchingStatement
	 */
	public IFact createMatchingStatement( int name, IRelation relation );

	/**
	 * returns a implementation of a Query
	 */
	public IFact createQuery( int name );

	/**
	 * returns a implementation of a IFact
	 */
	public IFact createFact( int name, IRelation relation );

	/**
	 * returns a implementation of a IFact
	 */
	public IFact createFact( int name );

	/**
	 * returns a implementation of a IAtom as Value
	 */
	public IAtom createValue( int value );

	/**
	 * returns a implementation of a IAtom as Variable
	 */
	public IAtom createVariable( int value );

	/**
	 * returns a implementation of a ISymbolTable
	 */
	public ISymbolTable getSymbolTable();
}
