BooleanLogic

class hybrid_learning.fuzzy_logic.tnorm_connectives.boolean.BooleanLogic(operators=None, **default_overrides)[source]

Bases: Logic

Boolean logic and parser. For details and examples see the super-class.

Public Data Attributes:

DEFAULT_CONNECTIVES

Default connectives by common names.

Inherited from : py: class:Logic

DEFAULT_CONNECTIVES

Default connectives by common names.

Public Methods:

Inherited from : py: class:Logic

op(symb)

Get the operator builder for the given symbol.

logical_(symb)

Get a variadic instance of the logical operation specified by symb.

parser()

Return a default parser for this logic.

is_pure(op)

Whether the formula op purely consists of operators built from this logic.

insert(precedence, op_builder)

Add an operator builder with precedence precedence.

Inherited from : py: class:MutableSequence

insert(precedence, op_builder)

Add an operator builder with precedence precedence.

append(value)

S.append(value) -- append value to the end of the sequence

clear()

reverse()

S.reverse() -- reverse IN PLACE

extend(values)

S.extend(iterable) -- extend sequence by appending elements from the iterable

pop([index])

Raise IndexError if list is empty or index is out of range.

remove(value)

S.remove(value) -- remove first occurrence of value.

Inherited from : py: class:Sequence

index(value, [start, [stop]])

Raises ValueError if the value is not present.

count(value)

Special Methods:

Inherited from : py: class:Logic

__init__([operators])

Init.

__setitem__(precedence, op_builder)

__getitem__(i)

__delitem__(i)

__len__()

__add__(other)

__radd__(other)

__repr__()

Return repr(self).

Inherited from : py: class:MutableSequence

__setitem__(precedence, op_builder)

__delitem__(i)

__iadd__(values)

Inherited from : py: class:Sequence

__getitem__(i)

__iter__()

__contains__(value)

__reversed__()

Inherited from : py: class:Reversible

__reversed__()

Inherited from : py: class:Sized

__len__()

Inherited from : py: class:Iterable

__iter__()

Inherited from : py: class:Container

__contains__(value)


Parameters
DEFAULT_CONNECTIVES: OrderedDict = {'AND': <class 'hybrid_learning.fuzzy_logic.tnorm_connectives.boolean.AND'>, 'IMPLIEDBY': <class 'hybrid_learning.fuzzy_logic.tnorm_connectives.boolean.IMPLIEDBY'>, 'IMPLIES': <class 'hybrid_learning.fuzzy_logic.tnorm_connectives.boolean.IMPLIES'>, 'NOT': <class 'hybrid_learning.fuzzy_logic.tnorm_connectives.boolean.NOT'>, 'OR': <class 'hybrid_learning.fuzzy_logic.tnorm_connectives.boolean.OR'>}

Default connectives by common names. Set None as default to force users to specify it during init. Set False to just mark the precedence position but not force users to specify an implementation during init. The order also determines the default order of precedence (higher index = higher precedence).