concepts.dsl.dsl_types#

Data structures for custom types in a DSL.

All types extend the base class TypeBase.

TypeBase has four derived types:

- :class:`ObjectType`: corresponds to an object in the physical world.
- :class:`ValueType`: corresponds to an encoding of a feature of the object.
- :class:`UnionType`: corresponds to a union of types.
- :class:`ListType`: corresponds to a list type.
- :class:`~concepts.dsl.dsl_functions.FunctionType`: corresponds to a function over the encodings.
- :class:`~concepts.dsl.dsl_functions.OverloadedFunctionType`: corresponds to a collection of functions that share the same name.

Furthermore, ValueType has four derived types:

- :class:`ConstantType`: corresponds to a constant.
- :class:`SequenceType`: corresponds to a sequence of values.
- :class:`TensorValueTypeBase`: corresponds to a tensor-based encoding.
- :class:`PyObjValueType`: corresponds to an arbitrary Python object.

Module attributes

AnyType

AutoType means the type will be automatically inferred later.

QINDEX

The "quantified index" object, used to indicate a quantified dimension in a tensor value type.

Functions

is_any_type(t)

Check if the type is AnyType.

is_auto_type(t)

Check if the type is AutoType.

Classes

ConstantType

The ConstantType corresponds to a constant value.

FormatContext

FormatContext is a context manager that controls the format of types and objects.

ListType

NamedTensorValueType

ObjectConstant

The class representing a constant object in a DSL.

ObjectType

The ObjectType corresponds to the type of "real-world" objects.

PyObjValueType

ScalarValueType

SequenceValueType

The SequenceValueType corresponds to a sequence of values of a certain type.

TensorValueTypeBase

A value type refers to a type of some features associated with physical objects.

TypeBase

Base class for all types.

UnionType

The UnionType is a type that is the union of multiple types.

UnnamedPlaceholder

ValueType

The ValueType corresponds to a value of a certain type.

Variable

The class representing a variable in a function.

VectorValueType