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.proof;
12:
13: import de.uka.ilkd.key.collection.ListOfString;
14: import de.uka.ilkd.key.java.Services;
15: import de.uka.ilkd.key.logic.op.SchemaVariable;
16: import de.uka.ilkd.key.rule.TacletApp;
17:
18: /**
19: * Composite of instantiation proposers.
20: */
21: public class InstantiationProposerCollection implements
22: InstantiationProposer {
23:
24: private ListOfInstantiationProposer proposers = SLListOfInstantiationProposer.EMPTY_LIST;
25:
26: /**
27: * adds an instantiation proposer to the collection
28: */
29: public void add(InstantiationProposer proposer) {
30: proposers = proposers.append(proposer);
31: }
32:
33: public String getProposal(TacletApp app, SchemaVariable var,
34: Services services, Node undoAnchor,
35: ListOfString previousProposals) {
36: IteratorOfInstantiationProposer it = proposers.iterator();
37: while (it.hasNext()) {
38: InstantiationProposer proposer = it.next();
39: String proposal = proposer.getProposal(app, var, services,
40: undoAnchor, previousProposals);
41: if (proposal != null) {
42: return proposal;
43: }
44: }
45:
46: return null;
47: }
48: }
|