eta.lf.Repetition

class Repetition(ep, nl, ulf, elf, condition, eventualities, prob=1.0)[source]

Bases: Eventuality

A Repetition is a special type of Eventuality that represents a repeating event.

In addition to the basic Eventuality attributes, it also has a condition and a sub-list of eventualities. The condition is either a ULF (or True for a repetition with no termination), such that the eventualities will occur until the condition is no longer true.

Such an event is indicated by a :repeat-until keyword in a schema.

ep
Type:

str

nl
Type:

str

ulf
Type:

ULF or None

elf
Type:

ELF or None

prob
Type:

float

bindings
Type:

dict

embedding
Type:

list[float]

condition

The stopping condition for repetition.

Type:

True or ULF

eventualities

The list of eventualities to repeat.

Type:

list[Eventuality]

Methods

bind

Bind the given variable symbol to the given value.

embed

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

Get the highest level of representation available for this eventuality (if no_bind is given as True, do not apply bindings).

replacevar

Replace the first variable symbol with the second variable symbol throughout the eventuality.

set_elf

Set the ULF formula.

set_ep

Set the episode symbol.

set_prob

Set the probability of this event.

set_ulf

Set the ULF formula.

unbind

Unbind the given variable symbol.

bind(var, val)[source]

Bind the given variable symbol to the given value.

unbind(var)[source]

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.