Rules

Inheritance diagram of authorityspoke.rules.Rule
class authorityspoke.rules.Rule(**data)

A statement of a legal doctrine about a Procedure for litigation.

May decide some aspect of current litigation, and also potentially may be cited and reused by future courts. When Rules appear as judicial holdings they are often hypothetical and don’t necessarily imply that the court accepts the Fact assertions or other Factors that make up the inputs or outputs of the Procedure mentioned in the Rule.

Parameters
  • procedure – a Procedure containing the inputs, and despite Factors and resulting outputs when this rule is triggered.

  • enactments – the Enactments cited as authority for invoking the procedure.

  • enactments_despite – the Enactments specifically cited as failing to preclude application of the procedure.

  • mandatory – whether the procedure is mandatory for the court to apply whenever the Rule is properly invoked. False means that the procedure is “discretionary”.

  • universalTrue if the procedure is applicable whenever its inputs are present. False means that the procedure is applicable in “some” situation where the inputs are present.

  • generic – whether the Rule is being mentioned in a generic context. e.g., if the Rule is being mentioned in an Argument object merely as an example of the kind of Rule that might be mentioned in such an Argument.

  • name – an identifier used to retrieve this Rule when needed for the composition of another Factor object.

classmethod validate_enactment_groups(v)

Convert EnactmentPassage to EnactmentGroup.

Return type

EnactmentGroup

classmethod select_enactment_text(v)

For Enactments with no text selection, select all text.

Return type

EnactmentGroup

property despite

Get despite Factors as a FactorGroup.

property inputs

Get input Factors as a FactorGroup.

property outputs

Get output Factors as a FactorGroup.

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.

add(other, context=None)

Create new Rule by using the outputs of self as inputs of other.

Return type

Optional[Rule]

__add__(other)

Create new Rule if self can satisfy the inputs of other.

If both self and other have False for universal, then returns None. Otherwise:

If the union of the inputs and outputs of self would trigger other, then return a new version of self with the output Factors of other as well as the outputs of self.

The new universal and mandatory values are the lesser of the old values for each.

Does not test whether self could be triggered by the outputs of other. Use other + self for that.

Parameters

other – another Rule to try to add to self

Return type

Optional[Rule]

Returns

a combined Rule that extends the procedural move made in self, if possible. Otherwise None.

get_contrapositives()

Make contrapositive forms of this Rule.

Used when converting from JSON input containing the entry "exclusive": True, which means the specified inputs` are the only way to reach the specified output. When that happens, it can be inferred that in the absence of any of the inputs, the output must also be absent. (Multiple outputs are not allowed when the exclusive flag is True.) So, this generator will yield one new Rule for each input.

Return type

Iterator[Rule]

Returns

iterator yielding Rules.

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

add_enactment(incoming)

Add Enactment and sort self’s Enactments.

Parameters

incoming (Enactment) – the new Enactment to be added to enactments

Return type

None

Returns

None

add_enactment_despite(incoming)

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

Parameters

incoming (Enactment) – the new Enactment to be added to enactments_despite

Return type

None

Returns

None

with_enactment(incoming)

Create new Rule with added Enactment.

Parameters

incoming (Enactment) – the new Enactment to be added to enactments_despite

Return type

Rule

Returns

a new version of self with the specified change

with_enactment_despite(incoming)

Create new Rule with added “despite” Enactment.

Parameters

incoming (Enactment) – the new Enactment to be added to enactments_despite

Return type

Rule

Returns

a new version of self with the specified change

add_factor(incoming)

Add a Factor to self.inputs.

Parameters

incoming (Factor) – the new Factor to be added to input

Return type

None

with_factor(incoming)

Make new version of self with an added input Factor.

Parameters

incoming (Factor) – the new Factor to be added to input

Return type

Optional[Rule]

Returns

a new version of self with the specified change

comparable_with(other)

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

Return type

bool

contradicts(other, context=None)

Test if self contradicts other.

Return type

bool

Returns

whether self contradicts other, if each is posited by a Holding with rule_valid` and decided

explanations_contradiction(other, context=None)

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

Return type

Iterator[ContextRegister]

needs_subset_of_enactments(other)

Test whether self's Enactment support is a subset of other's.

A Rule makes a more powerful statement if it relies on fewer Enactments (or applies despite more Enactments).

So this method must return True for self to imply other.

Return type

bool

explanations_implication(other, context=None)

Find context matches that would result in self implying other.

Return type

Iterator[ContextRegister]

implies(other, context=None)

Test if self implies other if posited in valid and decided Holdings.

If self relies for support on some Enactment text that other doesn’t, then self doesn’t imply other.

Also, if other specifies that it applies notwithstanding some Enactment not mentioned by self, then self doesn’t imply other.

This will be called as part of the Holding.__ge__() implication function.

Return type

bool

Returns

whether self implies other, assuming that both are Rule/s, and rule_valid and decided are True for both of them.

__ge__(other)

Call implies() as an alias.

Return type

bool

Returns

bool indicating whether self implies other

__len__()

Count generic Factors needed as context for this Rule.

Returns

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

has_all_same_enactments(other)

Test if self has Enactments with same meanings as other's.

Parameters

other (Rule) – another Rule to compare to self.

Return type

bool

Returns

whether the means() test passes for all Enactments

explanations_same_meaning(other, context=None)

Find context matches that would result in self and other meaning the same.

Return type

Iterator[ContextRegister]

means(other, context=None)

Test whether other has the same meaning as self.

Return type

bool

Returns

whether other is a Rule with the same meaning as self.

union(other, context=None)

Get new Rule with all the Factors of self and other.

Return type

Optional[Rule]

__or__(other)

Create new Rule showing combined effect of all inputs of self and other.

This operation is destructive in the sense that the new Rule may not contain all the information that was available in self and other.

This seems to work differently when one Rule implies the other. That could mean there is a union to return even when both Rules are SOME rules. Or it could mean an ALL rule should be returned even though implied is SOME, because implied contributes no information that wasn’t already in greater.

Parameters

other (Rule) – a Rule to be combined with self.

Return type

Optional[Rule]

Returns

a Rule indicating the combined effect of the input and despite Factors of self and other

set_inputs(factors)

Set factors required to invoke this Procedure.

Return type

None

set_despite(factors)

Set factors that do not preclude application of this Rule.

Return type

None

set_outputs(factors)

Set the outputs of this Rule.

Return type

None

set_enactments(enactments)

Set the list of Enactments cited as the basis for this Rule.

Any prior enactments are replaced.

Return type

None

set_enactments_despite(enactments)

Set the list of Enactments known not to preclude application of this Rule.

Any prior despite enactments are replaced.

Return type

None

__str__()

Return str(self).

__weakref__

list of weak references to the object (if defined)