class nettlesome.statements.Statement(**data)

An assertion that can be accepted as factual and compared to other Statements.

  • predicate – a natural-language clause with zero or more slots to insert terms that are typically the subject and objects of the clause.

  • terms – a series of Factor objects that fill in the blank spaces in the predicate statement.

  • name – an identifier for this object, often used if the object needs to be referred to multiple times in the process of composing other Factor objects.

  • absent – whether the absence, rather than the presence, of the legal fact described above is being asserted.

  • generic – whether this object could be replaced by another generic object of the same class without changing the truth of a :class:`~nettlesome.predicates.Predicate` in which it is mentioned.

  • truth – a new “truth” attribute for the “predicate”, if needed.

__hash__ = None

Create one-line string representation for inclusion in other Facts.


list of weak references to the object (if defined)


Create new Factor, replacing keys of changes with values.

Return type



a version of self with the new context.

property short_string: str

Represent object without line breaks.

Return type


property slug: str

Get a representation of self without whitespace.

Intended for use as a sympy Symbol

Return type


property str_with_concrete_context: str

Identify this Statement more verbosely, specifying which text is a concrete context factor.

Return type



the same as the __str__ method, but with an added “SPECIFIC CONTEXT” section


Generate permutations of context factors that preserve same meaning.

Return type


property term_sequence: nettlesome.terms.TermSequence

Return a TermSequence of the terms in this Statement.

Return type


property terms_without_nulls: Sequence[nettlesome.terms.Term]

Get Terms that are not None.

No Terms should be None for the Statement class, so this method is like an assertion for type checking.

Return type


property truth: Optional[bool]

Access truth attribute.

Return type


property wrapped_string

Wrap text in string representation of self.