pyirk._builtin.math_expressions

Math-/expression-related helper functions extracted from :mod:pyirk.builtin_entities.

Like the sibling modules :mod:pyirk._builtin.taxonomy and :mod:pyirk._builtin.scopes, this module only binds the (partially loaded) builtin_entities module object as _be. All accesses to its module-globals (items like I18, relations like R24 and qualifier factories like proxy_item) happen module-qualified and exclusively at call time inside function/method bodies — never at import time. References to symbols that also live in this module (e.g. new_tuple, get_arguments, new_mathematical_relation) stay direct names.

Module Contents

Classes

ImplicationStatement

Context manager to model conditional statements.

Functions

create_expression

get_arguments

Convenience function to simplify the access to the entities which are in itm.R36__has_argument_tuple.

create_evaluated_mapping

:param mapping: :param arg: :return:

new_equation

common special case of mathematical relation, also ensures backwards compatibility

new_mathematical_relation

get_proxy_item

new_tuple

Create a new tuple entity :param args: :return:

uq_instance_of

Shortcut to create an instance and set the relation R44[“is universally quantified”] to True in one step to allow compact notation.

Data

__all__

API

pyirk._builtin.math_expressions.__all__

[‘create_expression’, ‘get_arguments’, ‘create_evaluated_mapping’, ‘new_equation’, ‘new_mathematical…

pyirk._builtin.math_expressions.create_expression(latex_src: str, r1: str = None, r2: str = None) pyirk.core.Item
pyirk._builtin.math_expressions.get_arguments(self: pyirk.core.Item) Tuple[pyirk.core.Item]

Convenience function to simplify the access to the entities which are in itm.R36__has_argument_tuple.

pyirk._builtin.math_expressions.create_evaluated_mapping(mapping: pyirk.core.Item, *args) pyirk.core.Item

:param mapping: :param arg: :return:

pyirk._builtin.math_expressions.new_equation(lhs: pyirk.core.Item, rhs: pyirk.core.Item, doc=None, scope: Optional[pyirk.core.Item] = None, force_key: str = None) pyirk.core.Item

common special case of mathematical relation, also ensures backwards compatibility

pyirk._builtin.math_expressions.new_mathematical_relation(lhs: pyirk.core.Item, rsgn: str, rhs: pyirk.core.Item, doc=None, scope: Optional[pyirk.core.Item] = None, add_relations: dict = {}, force_key: str = None) pyirk.core.Item
pyirk._builtin.math_expressions.get_proxy_item(stm: pyirk.core.Statement, strict=True) pyirk.core.Item
pyirk._builtin.math_expressions.new_tuple(*args, **kwargs) pyirk.core.Item

Create a new tuple entity :param args: :return:

pyirk._builtin.math_expressions.uq_instance_of(type_entity: pyirk.core.Item, r1: str = None, r2: str = None) pyirk.core.Item

Shortcut to create an instance and set the relation R44[“is universally quantified”] to True in one step to allow compact notation.

:param type_entity: the type of which an instance is created :param r1: the label (tried to extract from calling context) :param r2: optional description

:return: new item

class pyirk._builtin.math_expressions.ImplicationStatement

Context manager to model conditional statements.

Example from irk:/math/0.2#I7169[“definition of identity matrix”]

with p.ImplicationStatement() as imp1:
    imp1.antecedent_relation(lhs=cm.i, rsgn="!=", rhs=cm.j)
    imp1.consequent_relation(lhs=M_ij, rhs=I5000["scalar zero"])

Initialization

__enter__()

implicitly called in the head of the with-statement

__exit__(exc_type, exc_val, exc_tb)
antecedent_relation(**kwargs)
consequent_relation(**kwargs)