Factors
¶
Things relevant to a
Court
’s application of aRule
.The same
Factor
that is in theoutputs
for theProcedure
of one legalRule
might be in theinputs
of theProcedure
for another.Initialize self. See help(type(self)) for accurate signature.
Get names of attributes to compare in
means()
or__ge__()
.This method and
interchangeable_factors()
should be the only parts of the context-matching process that need to be unique for each subclass ofFactor
.
List ways to reorder
context_factors
but preserveself
’s meaning.The empty list is the default return value for subclasses that don’t have any interchangeable
context_factors
.- Return type
List
[ContextRegister
]- Returns
the ways
context_factors
can be reordered without changing the meaning ofself
, or whether it would be true in a particular context.
Factor
s that can be replaced without changingself
s meaning.
Get
Factor
s used in comparisons with otherFactor
s.- Return type
- Returns
a tuple of attributes that are designated as the
context_factors
for whichever subclass ofFactor
calls this method. These can be used for comparing objects usingconsistent_with()
Collect self’s
context_factors
, and theircontext_factors
, recursively.
Check if self and other can be non-contradictory.
- Return type
Iterator
[ContextRegister
]- Returns
a bool indicating whether there’s at least one way to match the
context_factors
ofself
andother
, such that they fit the relationshipcomparison
.
Test whether
self
implies the absence ofother
.- Return type
- Returns
True
if self and other can’t both be true at the same time. Otherwise returnsFalse
.
Test whether
self
implies()
the absence ofother
.This should only be called after confirming that
other
is notNone
.- Return type
Iterator
[ContextRegister
]- Returns
True
if self and other can’t both be true at the same time. Otherwise returnsFalse
.
Make new object with attributes from
self.__dict__
, replacing attributes as specified.- Parameters
changes (
Union
[str
,Tuple
[str
, …],Dict
[str
,Any
]]) – adict
where the keys are names of attributes of self, and the values are new values for those attributes, or else an attribute name orlist
of names that need to have their values replaced with their boolean opposite.- Return type
- Returns
a new object initialized with attributes from
self.__dict__
, except that any attributes named as keys in the changes parameter are replaced by the corresponding value.
Test whether
self
andother
have identical meanings.
Generate ways to match contexts of self and other so they mean the same.
- Return type
Iterator
[ContextRegister
]
Search of
self
andself
’s attributes forFactor
with specifiedname
.
Generate
ContextRegister
s that cause self to imply other.If self is absent, then generate a ContextRegister from other’s point of view and then swap the keys and values.
- Return type
Iterator
[ContextRegister
]
Test whether
self
impliesother
.- Return type
Test whether
self
impliesother
andself
!=other
.- Return type
Test if relation holds for corresponding context factors of self and other.
This doesn’t track a persistent
ContextRegister
as it goes down the sequence ofFactor
pairs. Perhaps(?) this simpler process can weed outFactor
s that clearly don’t satisfy a comparison before moving on to the more costlyAnalogy
process. Or maybe it’s useful for testing.- Return type
Get a copy of
self
except ensuregeneric
isTrue
.Note
The new object created with this method will have all the attributes of
self
exceptgeneric=False
. Therefore the method isn’t equivalent to creating a new instance of the class with only thegeneric
attribute specified. To do that, you would useFact(generic=True)
.- Return type
- Returns
a new object changing
generic
toTrue
.
Create new
Factor
, replacing keys ofchanges
with values.
Return attributes of
self
that aren’t inherited from another class.Used for getting parameters to pass to
__init__()
when generating a new object.
Return str(self).
Use the regular string method unless otherwise specified.
Find ways to update
self_mapping
to allow relationshipcomparison
.- Parameters
other (
Optional
[Factor
]) – anotherFactor
being compared toself
register (
ContextRegister
) – keys representingFactor
s fromself
’s context and values representingFactor
s inother
’s context.comparison (
Callable
) – a function defining the comparison that must beTrue
betweenself
andother
. Could beFactor.means()
orFactor.__ge__()
.
- Yields
every way that
self_mapping
can be updated to be consistent withself
andother
having the relationshipcomparison
.- Return type
Iterator
[ContextRegister
]
list of weak references to the object (if defined)
Entities
¶
Things that exist in the outside world, like people, places, or events.
Not concepts that derive their meaning from litigation, such as a legal Fact, an Allegation, a Pleading, etc.
Best used to specify things to be mentioned in multiple
Factor
s in aRule
, often in thePredicate
of aFact
object.An
Entity
is often, but not always,generic
with respect to the meaning of theRule
in which it is mentioned, which means that theRule
is understood to apply generally even if some otherEntity
was substituted.- Parameters
name (Optional[str]) – An identifier. An
Entity
with the samename
is considered to refer to the same specific object, but if they have different names but aregeneric
and are otherwise the same, then they’re considered to have the same meaning and they evaluate equal to one another.generic (bool) – Determines whether a change in the
name
of theEntity
would change the meaning of theFactor
in which theEntity
is embedded.plural (bool) – Specifies whether the
Entity
object refers to more than one thing. In other words, whether it would be represented by a plural noun.
Test whether
other
has the same meaning asself
.Generic
Entity
objects are considered equivalent in meaning as long as they’re the same class. If notgeneric
, they’re considered equivalent if all their attributes are the same.
Call
implies()
as an alias.- Returns
bool indicating whether
self
impliesother
Return str(self).
Test whether
self
contradicts theother
Factor
.
Create new
Factor
, replacing keys ofchanges
with values.Assumes no changes are possible because the
new_context_helper()
decorator would have replacedself
if any replacement was available.- Return type
Facts
¶
An assertion accepted as factual by a court.
Often based on factfinding by a judge or jury.
- Parameters
predicate (
Predicate
) – a natural-language clause with zero or more slots to insertcontext_factors
that are typically the subject and objects of the clause.context_factors (
Sequence
[Factor
]) – a series ofFactor
objects that fill in the blank spaces in thepredicate
statement.name (
Optional
[str
]) – an identifier for this object, often used if the object needs to be referred to multiple times in the process of composing otherFactor
objects.standard_of_proof (
Optional
[str
]) – a descriptor for the degree of certainty associated with the assertion in thepredicate
.absent (
bool
) – whether the absence, rather than the presence, of the legal fact described above is being asserted.generic (
bool
) – whether this object could be replaced by another generic object of the same class without changing the truth of theRule
in which it is mentioned.
- Attr standards_of_proof
a tuple with every allowable name for a standard of proof, in order from weakest to strongest.
Exhibits
¶
A source of information for use in litigation.
TODO: Allowed inputs for
form
will need to be limited.
Pleadings
¶
A document filed by a party to make
Allegation
s.