public class ExistsFilter extends KBQueryFilter
Modifier and Type | Field and Description |
---|---|
(package private) int |
count |
private Formula |
pattern
Pattern that must match to apply the filter
|
private Formula |
pattern2 |
Constructor and Description |
---|
ExistsFilter()
Creates a new Filter on the pattern (B ??agt (exists ??var ??phi))
|
Modifier and Type | Method and Description |
---|---|
QueryResult |
apply(Formula formula,
ArrayList falsityReasons,
QueryResult.BoolWrapper goOn)
If the formula matches the pattern (B ??agent (exists ??var ??phi))
and ??agent equals the given agent term, this method returns a
QueryResult that corresponds to the answer to the query on
the incoming formula. |
private void |
cleanMatches(QueryResult results,
String varName)
Deletes the variable with the name given as argument from all
MatchResult of the given QueryResult.
|
boolean |
getObserverTriggerPatterns(Formula formula,
Set set)
Adds the formula corresponding to phi (see the patterns) where the variable
is transform into a MetaVariable.
|
toStrings
getMyKBase, setMyKBase
int count
private Formula pattern
private Formula pattern2
public ExistsFilter()
public QueryResult apply(Formula formula, ArrayList falsityReasons, QueryResult.BoolWrapper goOn)
QueryResult
that corresponds to the answer to the query on
the incoming formula. In all the MatchResults of this QueryResult,
the meta variable corresponding to the variable "??var" of the pattern
are deleted. 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 void cleanMatches(QueryResult results, String varName)
list
- a list of MatchResultvarName
- the name of the variable that should be deletes in all the
MatchResults of the given QueryResult.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.