seal5.transform.simplify_trivial_slices.visitor

A transformation module for simplifying M2-ISA-R behavior expressions. The following simplifications are done:

  • Resolvable m2isar.metamodel.arch.Constant s are replaced by m2isar.metamodel.behav.Literal s representing their value

  • Fully resolvable arithmetic operations are carried out and their results represented as a matching m2isar.metamodel.behav.Literal

  • Conditions and loops with fully resolvable conditions are either discarded entirely or transformed into code blocks without any conditions

  • Ternaries with fully resolvable conditions are transformed into only the matching part

  • Type conversions of m2isar.metamodel.behav.Literal s apply the desired type directly to the Literal and discard the type conversion

Functions

break_(self, context)

callable_(self, context)

group(self, context)

indexed_reference(self, context)

named_reference(self, context)

type_conv(self, context)

Classes

SimplifyTrivialSlicesVisitor()

Simplify trivial slice operations in behavioral expressions.