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.CollectionSort;
17: import de.uka.ilkd.key.logic.sort.oclsort.OclSort;
18:
19: /**
20: * Represents the OCL operation: any()
21: */
22: public class OclAny extends OclCollOpBound {
23:
24: public OclAny() {
25: super (new Name("$any"), OclSort.BOOLEAN, OclSort.OCLANY);
26: }
27:
28: public Sort sort(Term[] subTerm) {
29: helpSort(subTerm);
30: return ((CollectionSort) subTerm[0].sort()).getElemSort();
31: }
32:
33: public String toString() {
34: return (name() + ":" + OclSort.SEQUENCE_OF_OCLANY);
35: }
36:
37: public String proofToString() {
38: String s = OclSort.SEQUENCE_OF_OCLANY + " " + name();
39: s += "(" + OclSort.COLLECTION_OF_OCLANY + "," + OclSort.REAL;
40: s += ");\n";
41: return s;
42: }
43: }
|