00001 /* 00002 * (c) copyright 2008, Technische Universitaet Graz and Technische Universitaet Wien 00003 * 00004 * This file is part of jdiagengine. 00005 * 00006 * jdiagengine is free software: you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation, either version 3 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * jdiagengine is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * You should have received a copy of the GNU General Public License 00016 * along with jdiagengine. If not, see <http://www.gnu.org/licenses/>. 00017 * 00018 * Authors: Joerg Weber, Franz Wotawa 00019 * Contact: jweber@ist.tugraz.at (preferred), or fwotawa@ist.tugraz.at 00020 * 00021 */ 00022 00023 00038 package theoremprover; 00039 00040 import java.lang.*; // Java language classes 00041 import java.util.*; 00042 import theoremprover.*; 00043 00044 00045 public class LPredicate extends LObject 00046 { 00047 // Instance variables 00048 00049 public ArrayList arguments; 00050 public String identifier; 00051 00052 // Instance creation and initialization 00053 00054 LPredicate() 00055 { 00056 arguments = new ArrayList(); 00057 identifier = null; 00058 } 00059 00060 LPredicate(String str, ArrayList v) 00061 { 00062 arguments = v; 00063 identifier = str; 00064 } 00065 00066 // Accessing methods 00067 00068 public String toString() 00069 { 00070 StringBuffer str = new StringBuffer(); 00071 str.append(identifier); 00072 if (arguments.size() != 0) { 00073 str.append("("); 00074 Iterator e = arguments.iterator(); 00075 int i = arguments.size(); 00076 while (e.hasNext()) { 00077 str.append((e.next()).toString()); 00078 i--; 00079 if (i>0) { str.append(", ");} 00080 } 00081 str.append(")"); 00082 } 00083 return str.toString(); 00084 } 00085 00086 public PropositionalTheoremProver asPropositionalSentence() 00087 { 00088 return null; 00089 } 00090 00091 public ABTheoremProver asABPropositionalSentence() 00092 { 00093 return null; 00094 } 00095 00096 00097 public ArrayList allPredicates(String str, int i, ArrayList v) 00098 { 00099 if (identifier.equals(str) && (i == arguments.size())) { 00100 v.add(this); 00101 } 00102 return v; 00103 } 00104 }