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 (Tuple[Factor, ..]) – an outcome that a court may accept based on the presence of the
inputs
inputs (Tuple[Factor, ..]) – supporting
Factor
s in favor of theoutput
. Theinput
Factor
s are not treated as potential undercutters.despite (Tuple[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 (Optional[str]) – An identifier that can be used to reference and incorporate an existing procedure in a new
Factor
, instead of constructing a new copy of theProcedure
.absent (bool) – Whether the absence, rather than presence, of this
Procedure
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 this
Procedure
is being referenced as a generic example, which could be replaced by any otherProcedure
.
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.- Return type
- Returns
self
’s genericFactor
s, which must be matched to other genericFactor
s to perform equality or implication tests betweenFactor
s withFactor.means()
orFactor.__ge__()
.
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.
Explain why
other
can’t apply in all cases ifself
applies in some.- 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.
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 input ofother
is not equal to or implied by some input ofself
.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 despite ofother
is not equal to or implied by some despite or input ofself
.
Generate ways to match contexts of self and other so they mean the same.
- 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 thatother
hasuniversal: True
since otherwise we don’t know exactly what is required to triggerother
.
Find whether two sets of
Factor
s can be consistent.Works by first determining whether one
Factor
potentiallycontradicts()
another, and then determining whether it’s possible to make context assignments match between the contradictoryFactor
s.Note
Does
Factor: None
in matches always mean that theFactor
can avoid being matched in a contradictory way?- Returns
whether unassigned context factors can be assigned in such a way that there’s no contradiction between any factor in
self_factors
andother_factors
, given that someFactor
s have already been assigned as described bymatches
.
Find whether two sets of
Factor
s can be contradictory.- Parameters
self_factors (
Tuple
[Factor
, …]) – one set ofFactor
s with consistent context factors. Normally collected from theoutputs
attribute of aProcedure
.other_factors (
Tuple
[Factor
, …]) – a second set ofFactor
s with context factors that are internally consistent, but may not be consistent withself_factors
.matches – keys representing context
Factor
s inself_factors
and values representingFactor
s inother_factors
. The keys and values have been found in corresponding positions inself
andother
.
- Return type
Iterator
[ContextRegister
]- Returns
whether any
Factor
assignment can be found that makes aFactor
in the output ofother
contradict aFactor
in the output ofself
.