1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.qedeq.kernel.se.dto.module;
17
18 import org.qedeq.base.utility.EqualsUtility;
19 import org.qedeq.kernel.se.base.module.Axiom;
20 import org.qedeq.kernel.se.base.module.FormalProofList;
21 import org.qedeq.kernel.se.base.module.Formula;
22 import org.qedeq.kernel.se.base.module.FunctionDefinition;
23 import org.qedeq.kernel.se.base.module.InitialFunctionDefinition;
24 import org.qedeq.kernel.se.base.module.InitialPredicateDefinition;
25 import org.qedeq.kernel.se.base.module.LatexList;
26 import org.qedeq.kernel.se.base.module.PredicateDefinition;
27 import org.qedeq.kernel.se.base.module.ProofList;
28 import org.qedeq.kernel.se.base.module.Proposition;
29 import org.qedeq.kernel.se.base.module.Rule;
30
31
32
33
34
35
36
37 public class PropositionVo implements Proposition {
38
39
40 private Formula formula;
41
42
43 private LatexList description;
44
45
46 private ProofListVo proofList;
47
48
49 private FormalProofListVo formalProofList;
50
51
52
53
54 public PropositionVo() {
55
56 }
57
58 public Axiom getAxiom() {
59 return null;
60 }
61
62 public InitialPredicateDefinition getInitialPredicateDefinition() {
63 return null;
64 }
65
66 public PredicateDefinition getPredicateDefinition() {
67 return null;
68 }
69
70 public InitialFunctionDefinition getInitialFunctionDefinition() {
71 return null;
72 }
73
74 public FunctionDefinition getFunctionDefinition() {
75 return null;
76 }
77
78 public Proposition getProposition() {
79 return this;
80 }
81
82 public Rule getRule() {
83 return null;
84 }
85
86
87
88
89
90
91 public final void setFormula(final FormulaVo formula) {
92 this.formula = formula;
93 }
94
95 public final Formula getFormula() {
96 return formula;
97 }
98
99
100
101
102
103
104 public final void setDescription(final LatexListVo description) {
105 this.description = description;
106 }
107
108 public LatexList getDescription() {
109 return description;
110 }
111
112
113
114
115
116
117 public final void setProofList(final ProofListVo proofList) {
118 this.proofList = proofList;
119 }
120
121 public final ProofList getProofList() {
122 return proofList;
123 }
124
125
126
127
128
129
130 public final void addProof(final ProofVo proof) {
131 if (proofList == null) {
132 proofList = new ProofListVo();
133 }
134 proofList.add(proof);
135 }
136
137
138
139
140
141
142 public final void setFormalProofList(final FormalProofListVo formalProofList) {
143 this.formalProofList = formalProofList;
144 }
145
146 public final FormalProofList getFormalProofList() {
147 return formalProofList;
148 }
149
150
151
152
153
154
155 public final void addFormalProof(final FormalProofVo proof) {
156 if (formalProofList == null) {
157 formalProofList = new FormalProofListVo();
158 }
159 formalProofList.add(proof);
160 }
161
162 public boolean equals(final Object obj) {
163 if (!(obj instanceof PropositionVo)) {
164 return false;
165 }
166 final PropositionVo other = (PropositionVo) obj;
167 return EqualsUtility.equals(getFormula(), other.getFormula())
168 && EqualsUtility.equals(getDescription(), other.getDescription())
169 && EqualsUtility.equals(getProofList(), other.getProofList())
170 && EqualsUtility.equals(getFormalProofList(), other.getFormalProofList());
171 }
172
173 public int hashCode() {
174 return (getFormula() != null ? getFormula().hashCode() : 0)
175 ^ (getDescription() != null ? 1 ^ getDescription().hashCode() : 0)
176 ^ (getProofList() != null ? 2 ^ getProofList().hashCode() : 0)
177 ^ (getFormalProofList() != null ? 3 ^ getFormalProofList().hashCode() : 0);
178 }
179
180 public String toString() {
181 final StringBuffer buffer = new StringBuffer();
182 buffer.append("Proposition:\n");
183 buffer.append(getFormula());
184 buffer.append("\nDescription:\n");
185 buffer.append(getDescription());
186 buffer.append("\nProofs:\n");
187 buffer.append(getProofList());
188 buffer.append("\nFormal Proofs:\n");
189 buffer.append(getFormalProofList());
190 return buffer.toString();
191 }
192
193 }