public class Program extends net.sf.tweety.commons.util.rules.RuleSet<ASPRule> implements net.sf.tweety.logics.commons.syntax.interfaces.LogicProgram<ASPHead,ASPBodyElement,ASPRule>
| Constructor and Description |
|---|
Program()
Creates a new empty program.
|
Program(ASPLiteral query,
Set<ASPRule> rules)
Creates a new program with the given query and rules.
|
Program(Collection<ASPRule> rules)
Creates a new program with the given rules.
|
Program(Program other)
Copy-Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Program other)
Adds another program's content to the content of this program.
|
void |
addAll(List<ASPRule> rules) |
void |
addFact(ASPHead fact) |
void |
addFact(ASPLiteral fact) |
Program |
clone() |
boolean |
contains(ASPRule r)
Returns true if the program contains a given rule.
|
static Program |
defaultification(Program p)
Creates the defaultification p_d of a given program p.
|
Program |
exchange(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v,
net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t) |
Set<net.sf.tweety.logics.commons.syntax.Predicate> |
getOutputWhitelist()
Returns the whitelist of predicates.
|
ASPLiteral |
getQuery()
Returns the query of the program, if there is one.
|
Set<ASPRule> |
getRules()
Returns all rules of the program.
|
net.sf.tweety.logics.fol.syntax.FolSignature |
getSignature() |
boolean |
hasQuery()
Returns true if the program contains a query.
|
boolean |
isExtendedProgram()
Checks if the program is an extended program, meaning the heads of the
literals do not have more than one literal.
|
boolean |
isGround() |
boolean |
isSafe()
Returns true if the program is safe,
i.e.
|
Program |
reduct(Set<ASPLiteral> state)
Returns the reduct of this program wrt.
|
void |
setOutputWhitelist(Collection<net.sf.tweety.logics.commons.syntax.Predicate> ps)
Sets the whitelist of predicates.
|
void |
setQuery(ASPLiteral query)
Sets the query of the program.
|
Program |
substitute(Map<? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>,? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> map) |
Program |
substitute(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v,
net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t) |
String |
toString() |
getConclusions, getPremises, getRulesWithConclusion, getSyntacticModuleadd, clear, contains, isEmpty, iterator, remove, size, spliteratorequals, hashCode, removeAlladdAll, containsAll, retainAll, toArray, toArrayfinalize, getClass, notify, notifyAll, wait, wait, waitaddAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArrayparallelStream, removeIf, streampublic Program()
public Program(Collection<ASPRule> rules)
query - rules - public Program(ASPLiteral query, Set<ASPRule> rules)
query - rules - public Program(Program other)
other - public void setQuery(ASPLiteral query)
query - a literalpublic void addFact(ASPHead fact)
addFact in interface net.sf.tweety.logics.commons.syntax.interfaces.LogicProgram<ASPHead,ASPBodyElement,ASPRule>public net.sf.tweety.logics.fol.syntax.FolSignature getSignature()
getSignature in interface net.sf.tweety.commons.BeliefBasegetSignature in interface net.sf.tweety.logics.commons.syntax.interfaces.LogicProgram<ASPHead,ASPBodyElement,ASPRule>public Program substitute(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t) throws IllegalArgumentException
substitute in interface net.sf.tweety.logics.commons.syntax.interfaces.LogicProgram<ASPHead,ASPBodyElement,ASPRule>IllegalArgumentExceptionpublic Program substitute(Map<? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>,? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> map) throws IllegalArgumentException
substitute in interface net.sf.tweety.logics.commons.syntax.interfaces.LogicProgram<ASPHead,ASPBodyElement,ASPRule>IllegalArgumentExceptionpublic Program exchange(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t) throws IllegalArgumentException
exchange in interface net.sf.tweety.logics.commons.syntax.interfaces.LogicProgram<ASPHead,ASPBodyElement,ASPRule>IllegalArgumentExceptionpublic String toString()
toString in interface net.sf.tweety.commons.BeliefBasetoString in interface net.sf.tweety.logics.commons.syntax.interfaces.LogicProgram<ASPHead,ASPBodyElement,ASPRule>toString in class AbstractCollection<ASPRule>public boolean isGround()
public void setOutputWhitelist(Collection<net.sf.tweety.logics.commons.syntax.Predicate> ps)
ps - set of predicatespublic Set<net.sf.tweety.logics.commons.syntax.Predicate> getOutputWhitelist()
public boolean hasQuery()
public ASPLiteral getQuery()
public Program reduct(Set<ASPLiteral> state)
state - some set of literalspublic static Program defaultification(Program p)
p - The program which is not defaultificated yetpublic void addFact(ASPLiteral fact)
public boolean isExtendedProgram()
public void add(Program other)
other - Reference to the other program.public boolean contains(ASPRule r)
r - an ASP rulepublic boolean isSafe()
Copyright © 2019. All rights reserved.