eta.lf.Condition
- class Condition(ep, nl, ulf, elf, conditions, prob=1.0)[source]
Bases:
Eventuality
A Condition is a special type of Eventuality that represents a conditional event.
In addition to the basic Eventuality attributes, it also has a list of (<condition>, <eventualities>) pairs, where <condition> is either a ULF or True (for a default condition), and <eventualities> is a list of sub-eventualities that occur if the condition is true.
Such an event is indicated by a :try-in-sequence or :if keyword in e.g. a schema.
- conditions
A list of pairs of conditions and eventuality lists.
- Type:
list[tuple[True or ULF, list[Eventuality]]]
Methods
Bind the given variable symbol to the given value.
Embed the eventuality based on the natural language representation, given an embedder object.
Format an eventuality as ((<ep> <wff>) <prob>), where <wff> is the highest level of representation for this eventuality.
Get the ELF representation for this eventuality, applying any variable assignments.
Get the episode symbol for this eventuality, applying any variable assignments.
Get the natural language representation for this eventuality, applying any variable assignments.
Get the ULF representation for this eventuality, applying any variable assignments.
Get the highest level of representation available for this eventuality (if no_bind is given as True, do not apply bindings).
Replace the first variable symbol with the second variable symbol throughout the eventuality.
Set the ULF formula.
Set the episode symbol.
Set the probability of this event.
Set the ULF formula.
Unbind the given variable symbol.
- replacevar(var1, var2)[source]
Replace the first variable symbol with the second variable symbol throughout the eventuality.
- __eq__(other)
Return self==value.
- __hash__()
Return hash(self).
- __str__()
Return str(self).
- embed(embedder)
Embed the eventuality based on the natural language representation, given an embedder object.
- format()
Format an eventuality as ((<ep> <wff>) <prob>), where <wff> is the highest level of representation for this eventuality.
- get_elf()
Get the ELF representation for this eventuality, applying any variable assignments.
- get_ep()
Get the episode symbol for this eventuality, applying any variable assignments.
- get_nl()
Get the natural language representation for this eventuality, applying any variable assignments.
- get_ulf()
Get the ULF representation for this eventuality, applying any variable assignments.
- get_wff(no_bind=False)
Get the highest level of representation available for this eventuality (if no_bind is given as True, do not apply bindings).
- set_elf(elf)
Set the ULF formula.
- set_ep(ep)
Set the episode symbol.
- set_prob(prob)
Set the probability of this event.
- set_ulf(ulf)
Set the ULF formula.