Procedures¶
A (potential) rule for courts to use in resolving litigation.
Described in terms of inputs and outputs, and also potentially “despite”
Factor
s, which occur when aRule
could be said to apply “even if” some “despite” factor is true.Users generally should not need to interact with this class directly, under the current design. Instead, they should interact with the class
Rule
.- Parameters
outputs (
ComparableGroup
[Factor
]) – an outcome that a court may accept based on the presence of theinputs
inputs (
Optional
[ComparableGroup
[Factor
]]) – supportingFactor
s in favor of theoutput
. Theinput
Factor
s are not treated as potential undercutters.despite (
Optional
[ComparableGroup
[Factor
]]) –Factor
s that do not prevent the court from imposing theoutput
. These could be considered “failed undercutters” in defeasible logic. If aFactor
is relevant both as support for the output and as a potential undercutter, include it in bothinputs
anddespite
.name (
str
) – An identifier that can be used to reference and incorporate an existing procedure in a newFactor
, instead of constructing a new copy of theProcedure
.absent (
bool
) – Whether the absence, rather than presence, of thisProcedure
is being referenced. The usefulness of this is unclear, but I’m not prepared to eliminate it before theArgument
class has been implemented and tested.generic (
bool
) – Whether the thisProcedure
is being referenced as a generic example, which could be replaced by any otherProcedure
.
Initialize self. See help(type(self)) for accurate signature.
Add two Procedures, given that they have already been found to be addable.
Show how first Procedure triggers the second if not both are universal.
Yield as much of the context as seems likely correct based on this Procedure.
- Return type
Iterable
[ContextRegister
]
Combine two
Procedure
s into one.The new
Procedure
will have all of theinputs
,outputs
, anddespite
Factor
s of bothself
andother
.All of the context
Factor
s ofself
will remain the same.
Get number of generic
Factor
s specified forself
.
Return repr(self).
Return str(self).
Get
Factor
s ininputs
,outputs
, anddespite
.
Factor
s that can be replaced without changingself
s meaning.If
self.generic is True
then the only genericFactor
isself
. This could happen if theProcedure
was mentioned generically in anArgument
about preserving objections for appeal, for instance.
Add an output, input, or despite
Factor
.
Find if
self
applying in some cases impliesother
cannot apply in some.Raises an error because, by analogy with
Procedure.implies()
, users might expect this method to returnTrue
only whenRule
withuniversal=False
and Procedureself
would contradict anotherRule
withuniversal=False
and Procedureother
. But that would never happen.- Return type
Find if
self
applying in some cases impliesother
cannot apply in all.
Check if every input of other implies some input or despite factor of self.
- Return type
Iterator
[ContextRegister
]
Check if every input of other is implied by some input or despite factor of self.
- Return type
Iterator
[ContextRegister
]
Explain why
other
can’t apply in all cases ifself
applies in some.- Return type
Iterator
[ContextRegister
]
Yield contexts establishing that if self is always valid, other is always valid.
- Return type
Iterator
[ContextRegister
]
Find if
self
applying in all cases impliesother
applies in all.self
does not implyother
if any output ofother
is not equal to or implied by some output ofself
.For
self
to implyother
, every input ofself
must be implied by some input ofother
.self
does not implyother
if any despite ofother
contradicts()
an input ofself
.- Return type
- Returns
whether the assertion that
self
applies in all cases implies thatother
applies in all cases.
Yield contexts establishing that if self is always valid, other is sometimes valid.
- Return type
Iterator
[ContextRegister
]
Find if
self
applying in all cases impliesother
applies in some.For
self
to implyother
, every output ofother
must be equal to or implied by some output ofself
.For
self
to implyother
, every input ofself
must not be contradicted by any input or despite ofother
.self
does not implyother
if any “despite”Factor
s ofother
are not implied by inputs ofself
.- Return type
- Returns
whether the assertion that
self
applies in all cases implies thatother
applies in some cases (that is, if the list ofself
’s inputs is not considered an exhaustive list of the circumstances needed to invoke the procedure).
Find if
self
would implyother
if they aren’t absent.When
self
andother
are included inRule
s that both apply in some cases:self
does not implyother
if any output ofother
is not equal to or implied by some output of self.self
does not implyother
if any input ofother
is not equal to or implied by some input ofself
.self
does not implyother
if any despite ofother
is not equal to or implied by some despite or input ofself
.
Yield contexts that could cause self to have the same meaning as other.
- Return type
Iterator
[ContextRegister
]
Determine whether
other
has the same meaning asself
.
Create new
Procedure
, replacing keys ofchanges
with values.
Test if
Factor
s from firingself
would triggerother
.Note
To be confident that
self
actually can triggerother
, we would have to assume that self or other hasuniversal: True
since otherwise there could be a mismatch between what is provided and what is needed to triggerother
.
Test if Factors from firing self trigger other if both are universal.
The difference from
triggers_next_procedure()
is that this function doesn’t require the “despite”Factor
s to be addressed. If both callingRules
s apply in “ALL” cases where their inputs are present, then it doesn’t matter what Factors they apply “despite”.