Class FolSignature
java.lang.Object
org.tweetyproject.commons.QuadrupleSetSignature<Constant,Predicate,Functor,Sort>
org.tweetyproject.logics.fol.syntax.FolSignature
- Direct Known Subclasses:
ActionSignature
This class captures the signature of a specific
first-order language.
- Author:
- Matthias Thimm
-
Constructor Summary
ConstructorDescriptionCreates an empty signatureFolSignature
(boolean containsEquality) Creates an empty signature or an otherwise empty signature with equality.FolSignature
(Collection<?> c) Creates a signature with the given objects (should be sorts, constants, predicates, functors, or formulas).FolSignature
(Collection<?> c, boolean containsEquality) Creates a signature with the given objects (should be sorts, constants, predicates, functors, or formulas) and, if desired, equality. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the given object, either a constant, a sort, a predicate, or a functor, to this signature.void
addAll
(Collection<?> c) Adds items of the given collection to this signature.clone()
clones signatureboolean
Returns true if this signature contains the specified constant, predicate, functor, sort or all constants, predicates, functors and sorts in the specified FolFormula.boolean
Returns true if this signature contains the constant of the given name.boolean
Returns true if this signature contains the functor of the given name.boolean
Returns true if this signature contains the predicate of the given name.boolean
Returns true if this signature contains the sort of the given name.Get the constant with the given name.Returns the constants of this first-order logic signature.getFunctor
(String s) Get the functor with the given name.Returns the functors of this first-order logic signature.Get the predicate with the given name.Returns the predicates of this first-order logic signature.Get the sort with the given name.getSorts()
Returns the sorts of this first-order logic signature.boolean
isRepresentable
(FolFormula folFormula) Checks whether the given formula can be represented by this signature.void
Removes the given formula from this signature, if it is present (optional operation).toString()
Returns a string representation of this first-order logic signature.Methods inherited from class org.tweetyproject.commons.QuadrupleSetSignature
add, addSignature, clear, equals, hashCode, isEmpty, isOverlappingSignature, isSubSignature, removeAll
-
Constructor Details
-
FolSignature
public FolSignature()Creates an empty signature -
FolSignature
public FolSignature(boolean containsEquality) Creates an empty signature or an otherwise empty signature with equality.- Parameters:
containsEquality
- if true, the equality predicate is added to the signature
-
FolSignature
Creates a signature with the given objects (should be sorts, constants, predicates, functors, or formulas).- Parameters:
c
- a collection of items to be added.- Throws:
IllegalArgumentException
- if at least one of the given objects is neither a constant, a sort, a predicate, a functor, or a formula.
-
FolSignature
Creates a signature with the given objects (should be sorts, constants, predicates, functors, or formulas) and, if desired, equality.- Parameters:
c
- a collection of items to be added.containsEquality
- if true, the equality predicate is added to the signature- Throws:
IllegalArgumentException
- if at least one of the given objects is neither a constant, a sort, a predicate, a functor, or a formula.
-
-
Method Details
-
getConstants
-
getPredicates
-
getFunctors
-
getSorts
-
add
Adds the given object, either a constant, a sort, a predicate, or a functor, to this signature. If a constant is added its sort is added as well, the same is for any sort mentioned in predicates and functors. Alternatively, you can pass over a formula, then all predicates, sorts, constants, and functors of this formula are added to the signature.- Parameters:
obj
- the object to be added, either a constant, a sort, a predicate, a functor, or a formula.- Throws:
IllegalArgumentException
- if the given object is neither a constant, a sort, a predicate, a functor, or a formula.
-
addAll
Adds items of the given collection to this signature. These should be either constants, sorts, predicates, or functors. Alternatively, you can pass over formulas, then all predicates, sorts, constants, and functors of this formula are added t the signature.- Specified by:
addAll
in interfaceSignature
- Overrides:
addAll
in classQuadrupleSetSignature<Constant,
Predicate, Functor, Sort> - Parameters:
c
- the collection of items to be added- Throws:
IllegalArgumentException
- if at least one of the given objects is neither a constant, a sort, a predicate, a functor, or a formula.
-
isRepresentable
Checks whether the given formula can be represented by this signature.- Parameters:
folFormula
- A formula to be checked.- Returns:
- "true" if the given formula is representable, "false" otherwise.
-
getConstant
-
getPredicate
-
getFunctor
-
getSort
-
contains
Returns true if this signature contains the specified constant, predicate, functor, sort or all constants, predicates, functors and sorts in the specified FolFormula.- Parameters:
o
- either a constant, predicate, functor, sort or FolFormula- Returns:
- true if the signature contains the specified formula
-
containsConstant
Returns true if this signature contains the constant of the given name.- Parameters:
s
- name of constant- Returns:
- true if the signature contains the constant
-
containsPredicate
Returns true if this signature contains the predicate of the given name.- Parameters:
s
- name of predicate- Returns:
- true if the signature contains the predicate
-
containsFunctor
Returns true if this signature contains the functor of the given name.- Parameters:
s
- name of functor- Returns:
- true if the signature contains the functor
-
containsSort
Returns true if this signature contains the sort of the given name.- Parameters:
s
- name of sort- Returns:
- true if the signature contains the sort
-
toString
Returns a string representation of this first-order logic signature. -
remove
-
clone
Description copied from interface:Signature
clones signature
-