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: // This file is part of KeY - Integrated Deductive Software Design
10: // Copyright (C) 2001-2004 Universitaet Karlsruhe, Germany
11: // Universitaet Koblenz-Landau, Germany
12: // Chalmers University of Technology, Sweden
13: //
14: // The KeY system is protected by the GNU General Public License.
15: // See LICENSE.TXT for details.
16: package de.uka.ilkd.key.proof.mgt;
17:
18: import java.util.LinkedList;
19: import java.util.List;
20:
21: import de.uka.ilkd.key.pp.LogicPrinter;
22: import de.uka.ilkd.key.pp.NotationInfo;
23: import de.uka.ilkd.key.pp.ProgramPrinter;
24: import de.uka.ilkd.key.proof.Node;
25: import de.uka.ilkd.key.proof.Proof;
26: import de.uka.ilkd.key.rule.RuleApp;
27: import de.uka.ilkd.key.rule.Taclet;
28:
29: public class RuleJustificationByAddRules implements RuleJustification {
30:
31: private Node node;
32:
33: public RuleJustificationByAddRules(Node node) {
34: this .node = node;
35: }
36:
37: public List getProofList() {
38: return new LinkedList();
39: }
40:
41: public DepAnalysis dependsOn(Proof p) {
42: return DepAnalysis.getInstance(false, null, p); //correctness ensured
43: //by taclet mechanism
44: }
45:
46: public boolean isAxiomJustification() {
47: return true;
48: }
49:
50: public RuleApp motherTaclet() {
51: return node.getAppliedRuleApp();
52: }
53:
54: public String toString() {
55: LogicPrinter tacPrinter = new LogicPrinter(new ProgramPrinter(
56: null), NotationInfo.createInstance(), node.proof()
57: .getServices(), true);
58: tacPrinter.printTaclet((Taclet) (motherTaclet().rule()));
59: return "added rule justification \nintroduced at node "
60: + node.serialNr() + " by rule \n" + tacPrinter;
61: }
62:
63: }
|