View Javadoc

1   /* This file is part of the project "Hilbert II" - http://www.qedeq.org" target="alexandria_uri">http://www.qedeq.org
2    *
3    * Copyright 2000-2014,  Michael Meyling <mime@qedeq.org>.
4    *
5    * "Hilbert II" is free software; you can redistribute
6    * it and/or modify it under the terms of the GNU General Public
7    * License as published by the Free Software Foundation; either
8    * version 2 of the License, or (at your option) any later version.
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13   * GNU General Public License for more details.
14   */
15  
16  package org.qedeq.kernel.bo.logic.wf;
17  
18  import org.qedeq.kernel.bo.logic.common.ExistenceChecker;
19  import org.qedeq.kernel.bo.logic.common.FunctionKey;
20  import org.qedeq.kernel.bo.logic.common.PredicateKey;
21  import org.qedeq.kernel.se.common.RuleKey;
22  
23  
24  /**
25   * This implementation gives always the answer <code>true</code> to the question
26   * <em>exists this predicate?</em>.
27   *
28   * @author  Michael Meyling
29   */
30  public final class EverythingExists implements ExistenceChecker {
31  
32      /** One and only instance. */
33      private static final ExistenceChecker ALWAYS = new EverythingExists();
34  
35      /**
36       * Hidden constructor.
37       */
38      private EverythingExists() {
39          // nothing to do
40      }
41  
42      public boolean predicateExists(final String name, final int arguments) {
43          return true;
44      }
45  
46      public boolean predicateExists(final PredicateKey predicate) {
47          return true;
48      }
49  
50      public boolean isInitialPredicate(final PredicateKey predicate) {
51          return true;
52      }
53  
54      public boolean functionExists(final String name, final int arguments) {
55          return true;
56      }
57  
58      public boolean functionExists(final FunctionKey function) {
59          return true;
60      }
61  
62      public boolean isInitialFunction(final FunctionKey predicate) {
63          return true;
64      }
65  
66      public boolean classOperatorExists() {
67          return true;
68      }
69  
70      public boolean identityOperatorExists() {
71          return true;
72      }
73  
74      public String getIdentityOperator() {
75          return NAME_EQUAL;
76      }
77  
78      /**
79       * Get one instance of this class.
80       *
81       * @return  Class instance.
82       */
83      public static final ExistenceChecker getInstance() {
84          return ALWAYS;
85      }
86  
87      public boolean ruleExists(final RuleKey ruleKey) {
88          return true;
89      }
90  
91  }