Terms

class nettlesome.terms.Term

Things that can be referenced in a Statement.

The name of a Term can replace the placeholder in a StatementTemplate.

add(other, context=None)

Get a term that combines the meaning of self and other, if possible.

Parameters

other (Term) – another Term

Return type

Optional[Term]

Returns

the Term that implies the other, with self’s context. If neither returns the other, returns None.

explanations_consistent_with(other, context=None)

Get Term assignments resulting in no contradiction between self and other.

Return type

Iterator[Explanation]

generic_terms_by_str()

Get all generic Terms found in this Term, indexed by their string keys.

Return type

Dict[str, Term]

property recursive_terms: Dict[str, nettlesome.terms.Term]

Collect self’s terms, and their terms, recursively.

Return type

Dict[str, Term]

Returns

a dict (instead of a set, to preserve order) of Terms.