ModuleConstantsExistenceChecker.java
001 /* This file is part of the project "Hilbert II" - http://www.qedeq.org
002  *
003  * Copyright 2000-2011,  Michael Meyling <mime@qedeq.org>.
004  *
005  * "Hilbert II" is free software; you can redistribute
006  * it and/or modify it under the terms of the GNU General Public
007  * License as published by the Free Software Foundation; either
008  * version 2 of the License, or (at your option) any later version.
009  *
010  * This program is distributed in the hope that it will be useful,
011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
013  * GNU General Public License for more details.
014  */
015 
016 package org.qedeq.kernel.bo.module;
017 
018 import org.qedeq.kernel.bo.logic.common.ClassOperatorAlreadyExistsException;
019 import org.qedeq.kernel.bo.logic.common.ExistenceChecker;
020 import org.qedeq.kernel.bo.logic.common.FunctionConstant;
021 import org.qedeq.kernel.bo.logic.common.FunctionKey;
022 import org.qedeq.kernel.bo.logic.common.IdentityOperatorAlreadyExistsException;
023 import org.qedeq.kernel.bo.logic.common.PredicateConstant;
024 import org.qedeq.kernel.bo.logic.common.PredicateKey;
025 import org.qedeq.kernel.se.common.ModuleContext;
026 
027 /**
028  * Contains methods for existence checking of various operands.
029  *
030  @author  Michael Meyling
031  */
032 public interface ModuleConstantsExistenceChecker extends ExistenceChecker {
033 
034     public boolean predicateExists(final PredicateKey predicate);
035 
036     public boolean functionExists(final FunctionKey function);
037 
038     /**
039      * Get QEDEQ module where given function constant is defined.
040      *
041      @param   function    Function we look for.
042      @return  QEDEQ module where function constant is defined.
043      */
044     public KernelQedeqBo getQedeq(final FunctionKey function);
045 
046     /**
047      * Get QEDEQ module where given predicate constant is defined.
048      *
049      @param   predicate   Predicate we look for.
050      @return  QEDEQ module where predicate constant is defined.x
051      */
052     public KernelQedeqBo getQedeq(final PredicateKey predicate);
053 
054     public boolean classOperatorExists();
055 
056     /**
057      * Set the identity operator.
058      *
059      @param   identityOperator        Operator name. Might be <code>null</code>.
060      @param   identityOperatorModule  In this module the identity operator is defined.
061      @param   context                 Here we are within the module.
062      @throws  IdentityOperatorAlreadyExistsException  Already defined.
063      */
064     public void setIdentityOperatorDefined(final String identityOperator,
065             final KernelQedeqBo identityOperatorModule,
066             final ModuleContext context)
067             throws IdentityOperatorAlreadyExistsException;
068 
069     /**
070      * Set if the class operator is already defined.
071      *
072      @param   classOperatorModule  Module where class operator is defined.
073      @param   context              Context where we try to set new class operator.
074      @throws  ClassOperatorAlreadyExistsException Operator already defined.
075      */
076     public void setClassOperatorModule(
077             final KernelQedeqBo classOperatorModule,
078             final ModuleContext context)
079             throws ClassOperatorAlreadyExistsException;
080 
081     /**
082      * Get QEDEQ module where the class operator is defined within.
083      *
084      @return  Class operator defining module.
085      */
086     public KernelQedeqBo getClassOperatorModule();
087 
088     /**
089      * Get QEDEQ module where the identity operator is defined within.
090      *
091      @return  Identity operator defining module.
092      */
093     public KernelQedeqBo getIdentityOperatorModule();
094 
095     /**
096      * Get predicate constant definition.
097      *
098      @param   predicate   Get definition of this predicate.
099      @return  Definition.
100      */
101     public PredicateConstant get(final PredicateKey predicate);
102 
103     /**
104      * Get predicate constant definition.
105      *
106      @param   name        Name of predicate.
107      @param   arguments   Arguments of predicate.
108      @return  Definition. Might be <code>null</code>.
109      */
110     public PredicateConstant getPredicate(final String name, final int arguments);
111 
112     /**
113      * Get function constant definition.
114      *
115      @param   function    Get definition of this predicate.
116      @return  Definition. Might be <code>null</code>.
117      */
118     public FunctionConstant get(final FunctionKey function);
119 
120     /**
121      * Get function constant definition.
122      *
123      @param   name        Name of function.
124      @param   arguments   Arguments of function.
125      @return  Definition. Might be <code>null</code>.
126      */
127     public FunctionConstant getFunction(final String name, final int arguments);
128 
129 }