public class IREFilter extends KBQueryFilter
Modifier and Type | Field and Description |
---|---|
private Formula |
formulaPattern |
private ListOfNodes |
listOfNodes |
private Formula |
notPattern
Pattern that must match to apply the filter
|
private Formula |
pattern
Pattern that must match to apply the filter
|
private Term |
termPattern |
Constructor and Description |
---|
IREFilter()
Creates a new Filter on the patterns (B ??agent (= ??ire ??term)) and
(B ??agent (not (= ??ire ??term))).
|
Modifier and Type | Method and Description |
---|---|
QueryResult |
apply(Formula formula,
ArrayList falsityReasons,
QueryResult.BoolWrapper goOn)
If if the formula matches the pattern (B ??agent (= ??ire ??term))
or (B ??agent (not (= ??ire ??term)) and ??agent equals the given agent term,
this method returns a
QueryResult corresponding to the solution
to the question. |
boolean |
getObserverTriggerPatterns(Formula formula,
Set set)
By default, this method does nothing.
|
private void |
getPattern(IdentifyingExpression ire)
Creates the formulaPattern and the TermPattern by changing into meta variables
all the variables that appear in the term of the identifying expression.
|
private QueryResult |
notPatternProcess(Formula formula,
ListOfNodes listOfNodes,
Term termPattern,
Formula formulaPattern,
IdentifyingExpression ire,
Term term)
Returns a QueryResult corresponding to the answer to the query.
|
private QueryResult |
patternProcess(Formula formula,
ListOfNodes listOfNodes,
Term termPattern,
Formula formulaPattern,
IdentifyingExpression ire,
Term term)
Returns a QueryResult corresponding to the answer to the query.
|
toStrings
getMyKBase, setMyKBase
private Formula pattern
private Formula notPattern
private ListOfNodes listOfNodes
private Term termPattern
private Formula formulaPattern
public IREFilter()
public QueryResult apply(Formula formula, ArrayList falsityReasons, QueryResult.BoolWrapper goOn)
QueryResult
corresponding to the solution
to the question. Else it returns QueryResult.UNKNOWN
.apply
in class KBQueryFilter
formula
- a formula on which the filter is testedagent
- a term that represents the agent is trying to apply the filterKBase.query(Formula)
private QueryResult patternProcess(Formula formula, ListOfNodes listOfNodes, Term termPattern, Formula formulaPattern, IdentifyingExpression ire, Term term)
formula
- the formula to be queriedprivate QueryResult notPatternProcess(Formula formula, ListOfNodes listOfNodes, Term termPattern, Formula formulaPattern, IdentifyingExpression ire, Term term)
formula
- the formula to be queriedprivate void getPattern(IdentifyingExpression ire)
public boolean getObserverTriggerPatterns(Formula formula, Set set)
getObserverTriggerPatterns
in class KBQueryFilter
formula
- an observed formulaset
- set of patterns. Each pattern corresponds to a kind a formula
which, if it is asserted in the base, triggers the observer that
observes the formula given in parameter.