diff options
| author | RncLsn <rnc.lsn@gmail.com> | 2015-06-03 15:21:30 +0100 |
|---|---|---|
| committer | RncLsn <rnc.lsn@gmail.com> | 2015-06-03 15:21:30 +0100 |
| commit | b3b822d187a6402a39d30e471fe90a5dfad64312 (patch) | |
| tree | 912e1914610c8cf6103b7b7aef07087ddd7eb62f /src/uk/ac/ox/cs/pagoda/reasoner/ConsistencyManager.java | |
| parent | 691964863246bbf6ef9f72cc5e82c83df34f135a (diff) | |
| download | ACQuA-b3b822d187a6402a39d30e471fe90a5dfad64312.tar.gz ACQuA-b3b822d187a6402a39d30e471fe90a5dfad64312.zip | |
Before reintroducing extended queries.
Diffstat (limited to 'src/uk/ac/ox/cs/pagoda/reasoner/ConsistencyManager.java')
| -rw-r--r-- | src/uk/ac/ox/cs/pagoda/reasoner/ConsistencyManager.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/uk/ac/ox/cs/pagoda/reasoner/ConsistencyManager.java b/src/uk/ac/ox/cs/pagoda/reasoner/ConsistencyManager.java index 453b5ca..3fd2fbd 100644 --- a/src/uk/ac/ox/cs/pagoda/reasoner/ConsistencyManager.java +++ b/src/uk/ac/ox/cs/pagoda/reasoner/ConsistencyManager.java | |||
| @@ -23,6 +23,7 @@ import uk.ac.ox.cs.pagoda.tracking.TrackingRuleEncoder; | |||
| 23 | import uk.ac.ox.cs.pagoda.util.Timer; | 23 | import uk.ac.ox.cs.pagoda.util.Timer; |
| 24 | import uk.ac.ox.cs.pagoda.util.Utility; | 24 | import uk.ac.ox.cs.pagoda.util.Utility; |
| 25 | import uk.ac.ox.cs.pagoda.util.disposable.Disposable; | 25 | import uk.ac.ox.cs.pagoda.util.disposable.Disposable; |
| 26 | import uk.ac.ox.cs.pagoda.util.disposable.DisposedException; | ||
| 26 | 27 | ||
| 27 | import java.util.LinkedList; | 28 | import java.util.LinkedList; |
| 28 | 29 | ||
| @@ -49,6 +50,8 @@ public class ConsistencyManager extends Disposable { | |||
| 49 | } | 50 | } |
| 50 | 51 | ||
| 51 | public void extractBottomFragment() { | 52 | public void extractBottomFragment() { |
| 53 | if(isDisposed()) throw new DisposedException(); | ||
| 54 | |||
| 52 | if(fragmentExtracted) return; | 55 | if(fragmentExtracted) return; |
| 53 | fragmentExtracted = true; | 56 | fragmentExtracted = true; |
| 54 | 57 | ||
| @@ -141,10 +144,14 @@ public class ConsistencyManager extends Disposable { | |||
| 141 | } | 144 | } |
| 142 | 145 | ||
| 143 | public QueryRecord[] getQueryRecords() { | 146 | public QueryRecord[] getQueryRecords() { |
| 147 | if(isDisposed()) throw new DisposedException(); | ||
| 148 | |||
| 144 | return botQueryRecords; | 149 | return botQueryRecords; |
| 145 | } | 150 | } |
| 146 | 151 | ||
| 147 | boolean checkRLLowerBound() { | 152 | boolean checkRLLowerBound() { |
| 153 | if(isDisposed()) throw new DisposedException(); | ||
| 154 | |||
| 148 | fullQueryRecord = m_queryManager.create(QueryRecord.botQueryText, 0); | 155 | fullQueryRecord = m_queryManager.create(QueryRecord.botQueryText, 0); |
| 149 | AnswerTuples iter = null; | 156 | AnswerTuples iter = null; |
| 150 | 157 | ||
| @@ -175,6 +182,8 @@ public class ConsistencyManager extends Disposable { | |||
| 175 | // } | 182 | // } |
| 176 | 183 | ||
| 177 | boolean checkELLowerBound() { | 184 | boolean checkELLowerBound() { |
| 185 | if(isDisposed()) throw new DisposedException(); | ||
| 186 | |||
| 178 | fullQueryRecord.updateLowerBoundAnswers(m_reasoner.elLowerStore.evaluate(fullQueryRecord.getQueryText(), fullQueryRecord | 187 | fullQueryRecord.updateLowerBoundAnswers(m_reasoner.elLowerStore.evaluate(fullQueryRecord.getQueryText(), fullQueryRecord |
| 179 | .getAnswerVariables())); | 188 | .getAnswerVariables())); |
| 180 | if(fullQueryRecord.getNoOfSoundAnswers() > 0) { | 189 | if(fullQueryRecord.getNoOfSoundAnswers() > 0) { |
| @@ -185,6 +194,8 @@ public class ConsistencyManager extends Disposable { | |||
| 185 | } | 194 | } |
| 186 | 195 | ||
| 187 | boolean checkUpper(BasicQueryEngine upperStore) { | 196 | boolean checkUpper(BasicQueryEngine upperStore) { |
| 197 | if(isDisposed()) throw new DisposedException(); | ||
| 198 | |||
| 188 | if(upperStore != null) { | 199 | if(upperStore != null) { |
| 189 | AnswerTuples tuples = null; | 200 | AnswerTuples tuples = null; |
| 190 | try { | 201 | try { |
| @@ -202,6 +213,8 @@ public class ConsistencyManager extends Disposable { | |||
| 202 | } | 213 | } |
| 203 | 214 | ||
| 204 | boolean check() { | 215 | boolean check() { |
| 216 | if(isDisposed()) throw new DisposedException(); | ||
| 217 | |||
| 205 | // if (!checkRLLowerBound()) return false; | 218 | // if (!checkRLLowerBound()) return false; |
| 206 | // if (!checkELLowerBound()) return false; | 219 | // if (!checkELLowerBound()) return false; |
| 207 | // if (checkLazyUpper()) return true; | 220 | // if (checkLazyUpper()) return true; |
