01: // This file is part of KeY - Integrated Deductive Software Design
02: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
03: // Universitaet Koblenz-Landau, Germany
04: // Chalmers University of Technology, Sweden
05: //
06: // The KeY system is protected by the GNU General Public License.
07: // See LICENSE.TXT for details.
08: //
09: //
10:
11: package de.uka.ilkd.key.logic.op.oclop;
12:
13: import de.uka.ilkd.key.logic.Name;
14: import de.uka.ilkd.key.logic.Term;
15: import de.uka.ilkd.key.logic.sort.Sort;
16: import de.uka.ilkd.key.logic.sort.oclsort.OclSort;
17:
18: /**
19: * Represents the OCL operations: select(), reject()
20: */
21: public class OclSubsetOp extends OclCollOpBound {
22:
23: public OclSubsetOp(Name name) {
24: super (name, OclSort.BOOLEAN, OclSort.COLLECTION_OF_OCLANY);
25: }
26:
27: public Sort sort(Term[] subTerm) {
28: helpSort(subTerm);
29: return subTerm[0].sort();
30: }
31:
32: public String toString() {
33: return (name() + ":" + OclSort.COLLECTION_OF_OCLANY);
34: }
35:
36: public String proofToString() {
37: String s = OclSort.COLLECTION_OF_OCLANY + " " + name();
38: s += "(" + OclSort.COLLECTION_OF_OCLANY + "," + OclSort.BOOLEAN;
39: s += ");\n";
40: return s;
41: }
42: }
|