Holdings

class authorityspoke.holdings.Holding(**data)

An Opinion’s announcement that it posits or rejects a legal Rule.

Note that if an opinion merely says the court is not deciding whether a Rule is valid, there is no Holding, and no Rule object should be created. Deciding not to decide a Rule’s validity is not the same thing as deciding that the Rule is undecided.

Parameters
  • rule – a statement of a legal doctrine about a Procedure for litigation.

  • rule_validTrue means the Rule is asserted to be valid (or useable by a court in litigation). False means it’s asserted to be invalid.

  • decidedFalse means that it should be deemed undecided whether the Rule is valid, and thus can have the effect of overruling prior holdings finding the Rule to be either valid or invalid. Seemingly, decided=False should render the rule_valid flag irrelevant.

  • exclusive – if True, the stated rule is asserted to be the only way to establish the output that is the output of the rule.

  • generic – if True, indicates that the specific attributes of this holding are irrelevant in the context of a different holding that is referencing this holding.

classmethod nest_factor_fields(values)

Move misplaced fields that belong on Rule or Predicate models.

classmethod not_invalid_and_exclusive(v, values)

Block “exclusive” flag from being used when “rule_valid” is False.

Return type

bool

classmethod not_undecided_and_exclusive(v, values)

Block “exclusive” flag from being used when “decided” is False.

Return type

bool

classmethod from_factors(outputs, inputs=None, despite=None, enactments=(), enactments_despite=(), mandatory=False, universal=False, generic=False, decided=True, exclusive=False, absent=False)

Create new Holding without an existing Rule or Procedure.

property procedure

Get Procedure from Rule.

property despite

Get Factors that specifically don’t preclude application of the Holding.

property inputs

Get inputs from Procedure.

property outputs

Get outputs from Procedure.

property enactments

Get Enactments required to apply the Holding.

property enactments_despite

Get Enactments that specifically don’t preclude application of the Holding.

property recursive_terms

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.

property terms

Call Procedure's terms() method.

Return type

TermSequence

Returns

terms from self’s Procedure

generic_terms_by_str()

Get Factors that can be replaced without changing selfs meaning.

Return type

Dict[str, Comparable]

Returns

generic Factors from self’s Procedure

property mandatory

Whether court “MUST” apply holding when it is applicable.

Return type

bool

property universal

Whether holding is applicable in “ALL” cases where inputs are present.

Return type

bool

add_if_not_exclusive(other)

Show how first Holding triggers second, assumed not to be “exclusive” way to reach result.

Return type

Optional[Holding]

add_enactment(enactment)

Add enactment and sort self’s Enactments.

Return type

None

add_enactment_despite(enactment)

Add “despite” enactment and sort self’s “despite” Enactments.

Return type

None

add_holding(other)

Show how first Holding triggers the second.

Return type

Optional[Holding]

__add__(other)

Create new Holding combining self and other into a single step, if possible.

The Holdings can be combined only if the application of Holding self necessarily provides all the required inputs for the application of other.

Return type

Union[Rule, Holding, None]

explanations_contradiction(other, context=None)

Find context matches that would result in a contradiction with other.

Works by testing whether self would imply other if other had an opposite value for rule_valid.

This method takes three main paths depending on whether the holdings self and other assert that rules are decided or undecided.

A decided Rule can never contradict a previous statement that any Rule was undecided.

If rule A implies rule B, then a holding that B is undecided contradicts a prior Rule deciding that rule A is valid or invalid.

Parameters

other (Factor) – The Factor to be compared to self. Unlike with contradicts(), this method cannot be called with an Opinion for other.

Return type

Iterator[Explanation]

Returns

a generator yielding ContextRegisters that cause a contradiction.

__ge__(other)

Call implies() as an alias.

Return type

bool

Returns

bool indicating whether self implies other

comparable_with(other)

Check if other can be compared to self for implication or contradiction.

Return type

bool

implies(other, context=None)

Test for implication.

See Procedure.implies_all_to_all() and Procedure.implies_all_to_some() for explanations of how inputs, outputs, and despite Factors affect implication.

Parameters

other (Optional[Comparable]) – A Holding to compare to self, or a Rule to convert into such a Holding and then compare

Return type

bool

Returns

whether self implies other

explanations_implication(other, context=None)

Yield contexts that would cause self and other to have same meaning.

Return type

Iterator[ContextRegister]

implied_by(other, context=None)

Test if other implies self.

This function is for handling implication checks for classes that don’t know the structure of the Holding class, such as Fact and Rule.

Return type

bool

__len__()

Count generic Factors needed as context for this Holding.

Returns

the number of generic Factors needed for self’s Procedure.

property inferred_from_exclusive

Yield Holdings that can be inferred from the “exclusive” flag.

The generator will be empty if self.exclusive is False.

Return type

List[Holding]

explanations_same_meaning(other, context=None)

Yield contexts that would cause self and other to have same meaning.

Return type

Iterator[ContextRegister]

negated()

Get new copy of self with an opposite value for rule_valid.

new_context(changes)

Create new Holding, replacing keys of changes with values.

Return type

Factor

Returns

a version of self with the new context.

property nonexclusive_holdings

Yield all Holdings with exclusive is False implied by self.

Return type

HoldingGroup

set_inputs(factors)

Set inputs of this Holding.

Return type

None

set_despite(factors)

Set Factors that specifically do not preclude applying this Holding.

Return type

None

set_outputs(factors)

Set outputs of this Holding.

Return type

None

set_enactments(enactments)

Set Enactments required to apply this Holding.

Return type

None

set_enactments_despite(enactments)

Set Enactments that specifically do not preclude applying this Holding.

Return type

None

union(other, context=None)

Infer a Holding from all inputs and outputs of self and other, in context.

Creates a new Holding with all of the inputs and all of the outputs of both of the two original Holdings.

However, you only get such a new Holding if it can be inferred by accepting the truth of the two original Holdings.

If self contradicts() other, the operation returns None. Likewise, if the two original Holdings both have the value False for the parameter universal, the operation will return None if it’s possible that the “SOME” cases where one of the original Holdings applies don’t overlap with the “SOME” cases where the other applies.

Return type

Optional[Holding]

__or__(other)

Infer a Holding from all inputs and outputs of self and other.

Return type

Optional[Holding]

__str__()

Return str(self).

__weakref__

list of weak references to the object (if defined)