Documentation

Strata.DL.Imperative.MetaData

MetaData #

The Imperative dialect has a mechanism to store metadata in each of its constructs. Metadata can be used to track both syntactic facts obtained during translation from the source program to this dialect (e.g., line and column numbers), or semantic facts derived during analyses (e.g., global variables implicitly modified by a language construct).

A metadata field, which can be either a variable or an arbitrary string label.

For now, we only track the variables modified by a construct, but we will expand this in the future.

Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Equations
    • One or more equations did not get rendered due to their size.

    A metadata value, which can be either an expression, a message, or a fileRange

    Instances For
      Equations
      • One or more equations did not get rendered due to their size.
      Equations
      • One or more equations did not get rendered due to their size.

      A metadata element

      • fld : Field P

        The field or key used to identify the metadata.

      • value : Value P

        The value of the metadata.

      Instances For
        @[reducible, inline]

        Metadata is an array of tagged elements.

        Equations
        Instances For

          Push a new metadata element.

          Equations
          Instances For

            Remove the first metadata element with tag fld.

            Equations
            Instances For

              Retrieve the first metadata element with tag fld.

              Equations
              Instances For
                Equations
                Instances For
                  Equations
                  • One or more equations did not get rendered due to their size.
                  Equations
                  • One or more equations did not get rendered due to their size.

                  Common metadata fields #

                  @[reducible, match_pattern, inline]
                  Equations
                  Instances For
                    @[reducible, match_pattern, inline]
                    Equations
                    Instances For
                      @[reducible, match_pattern, inline]
                      Equations
                      Instances For
                        @[reducible, match_pattern, inline]
                        Equations
                        Instances For
                          @[reducible, match_pattern, inline]
                          Equations
                          Instances For
                            @[reducible, match_pattern, inline]
                            Equations
                            Instances For
                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For

                                        Create a DiagnosticModel from metadata and a message. Uses the file range from metadata if available, otherwise uses a default location.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For

                                          Create a DiagnosticModel from metadata and a Format message.

                                          Equations
                                          Instances For
                                            def Imperative.MetaData.formatFileRangeD {P : PureExpr} [BEq P.Ident] (md : MetaData P) (fileMap : Option Lean.FileMap := none) (includeEnd? : Bool := false) :

                                            Get the file range from metadata as a DiagnosticModel (for formatting). This is a compatibility function that formats the file range using byte offsets. For proper line/column display, use toDiagnostic and format with a FileMap at the top level.

                                            Equations
                                            Instances For

                                              Metadata field for a related file range (e.g., the original assertion location when the primary file range points to the call site after inlining). There can be multiple relatedFileRange fields in a single metadata due to multiple levels of inlining.

                                              Equations
                                              Instances For

                                                Get all related file ranges from metadata, in order. The returned array's order is determined by the call stack: the innermost (most deeply inlined) call comes first.

                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For

                                                  Remove all metadata elements with the given field.

                                                  Equations
                                                  Instances For

                                                    Replace the primary file range with a new one, shifting existing related file ranges and prepending the old primary range.

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For

                                                      Metadata field for property type classification (e.g., "divisionByZero").

                                                      Equations
                                                      Instances For

                                                        Metadata value for division-by-zero property type classification.

                                                        Equations
                                                        Instances For

                                                          Read the property type classification from metadata, if present.

                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For

                                                            Metadata field for property summaries attached to assert/requires/ensures clauses.

                                                            Equations
                                                            Instances For

                                                              Read the property summary from metadata, if present.

                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For

                                                                Push a property summary into metadata.

                                                                Equations
                                                                Instances For