Documentation

Cvc.Sys.Trace

inductive Cvc.Symbols.Trace {Struct : Symbols.Repr} (State : Symbols Struct) (Repr : NatType) (length : Nat) :

A trace of length indexed data.

Roughly equivalent to a list of indexed data with decreasing indices (length - 1 to 0). Note that this means the data of index 0 (if any) is always the very last element in the trace.

Instances For
    @[reducible, inline]
    abbrev Cvc.Symbols.TermTrace {Struct : Symbols.Repr} (State : Symbols Struct) (length : Nat) :

    A trace of terms.

    Equations
    Instances For
      @[reducible, inline]
      abbrev Cvc.Symbols.ValueTrace {Struct : Symbols.Repr} (State : Symbols Struct) (length : Nat) :

      A trace of values.

      Equations
      Instances For
        def Cvc.Symbols.Trace.mkOne {Struct : Symbols.Repr} [State : Symbols Struct] {Repr : NatType} (data : Repr 0) :
        State.Trace Repr 1

        Builds a trace of length 1.

        Equations
        Instances For
          def Cvc.Symbols.Trace.get {Struct✝ : Symbols.Repr} {S : Symbols Struct✝} {R : NatType} {k : Nat} :
          S.Trace R k(idx : Nat) → (in_range : autoParam (idx < k) _auto✝) → R idx

          Retrieves a state in a trace from its index.

          Equations
          Instances For
            def Cvc.Symbols.Trace.get? {Struct✝ : Symbols.Repr} {S : Symbols Struct✝} {R : NatType} {k : Nat} (trace : S.Trace R k) (idx : Nat) :
            Option (R idx)

            Retrieves a state in a trace from its index.

            Equations
            Instances For
              def Cvc.Symbols.Trace.decons {Struct✝ : Symbols.Repr} {S : Symbols Struct✝} {R : NatType} {k : Nat} :
              S.Trace R (k + 1)R k × S.Trace R k

              Deconstructs a non-empty trace.

              Equations
              Instances For
                def Cvc.Symbols.Trace.getData {Struct✝ : Symbols.Repr} {S : Symbols Struct✝} {R : NatType} {k : Nat} (trace : S.Trace R (k + 1)) :
                R k

                Data at index k.

                Equations
                Instances For
                  def Cvc.Symbols.Trace.getTail {Struct✝ : Symbols.Repr} {S : Symbols Struct✝} {R : NatType} {k : Nat} (trace : S.Trace R (k + 1)) :
                  S.Trace R k

                  Tail of a non-empty trace.

                  Equations
                  Instances For
                    @[reducible, inline]
                    abbrev Cvc.Symbols.Trace.Rev {Struct : Symbols.Repr} (State : Symbols Struct) (Repr : NatType) (k : Nat) :

                    Alias for a reversed Trace, used to change the .

                    Actually a normal Trace, but Repr is manipulated so that the Repr-data at index idx is actually Repr (k - idx - 1). As a result Repr 0 is always the first element in the trace, as opposed to a regular Trace.

                    Rev traces should not be used in Trace.cons: the first data having index 0 we can only put data of index 0 in front of it, which does not make sense.

                    TODO #

                    • make opaque or handle differently?
                    Equations
                    Instances For
                      @[irreducible]
                      def Cvc.Symbols.Trace.reverse.loop {Struct : Symbols.Repr} {R : NatType} [State : Symbols Struct] (k i : Nat) (trace : State.Trace R i) (acc : State.Trace (fun (idx : Nat) => R (k - idx - 1)) (k - i)) (h_i : i k := by (try simp [*]) <;> omega) :
                      Trace.Rev State R k

                      Auxiliary function for reversing trace, tail-recursive.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        def Cvc.Symbols.Trace.reverse {Struct : Symbols.Repr} {R : NatType} {k : Nat} [State : Symbols Struct] (trace : State.Trace R k) :
                        Trace.Rev State R k

                        Reverses a trace, tail-recursive.

                        Equations
                        Instances For
                          @[reducible, inline]
                          abbrev Cvc.Symbols.Trace.rev {Struct : Symbols.Repr} {R : NatType} {k : Nat} [State : Symbols Struct] (trace : State.Trace R k) :
                          Trace.Rev State R k

                          Reverses a trace, tail-recursive.

                          Equations
                          Instances For
                            @[irreducible]
                            def Cvc.Symbols.Trace.mapM.loop {m : TypeType u_1} [Monad m] {k : Nat} {R R' : NatType} {Struct✝ : Symbols.Repr} {State : Symbols Struct✝} {Struct✝¹ : Symbols.Repr} {S : Symbols Struct✝¹} (f : (i : Fin k) → R im (R' i)) (i : Fin k) (data : R i) (tail : State.Trace R i) :
                            m (S.Trace R' i.succ)

                            Auxiliary function for Trace.mapM.

                            Equations
                            Instances For
                              def Cvc.Symbols.Trace.mapM {m : TypeType u_1} [Monad m] {Struct✝ : Symbols.Repr} {S : Symbols Struct✝} {R : NatType} {k : Nat} {R' : NatType} (trace : S.Trace R k) (f : (i : Fin k) → R im (R' i)) :
                              m (S.Trace R' k)

                              Monadic map over trace data.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                def Cvc.Symbols.Trace.map {Struct✝ : Symbols.Repr} {S : Symbols Struct✝} {R : NatType} {k : Nat} {R' : NatType} (trace : S.Trace R k) (f : (i : Fin k) → R iR' i) :
                                S.Trace R' k

                                Map over trace data.

                                Equations
                                Instances For
                                  @[irreducible]
                                  def Cvc.Symbols.Trace.forIn.loop {m : Type u_1 → Type u_2} [Monad m] {k : Nat} {R : NatType} {β : Type u_1} {Struct✝ : Symbols.Repr} {S : Symbols Struct✝} (f : (i : Fin k) × R iβm (ForInStep β)) (acc : β) (i : Fin k) (data : R i) (tail : S.Trace R i) :
                                  m β

                                  Auxiliary function for Trace.forIn.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    def Cvc.Symbols.Trace.forIn {m : Type u_1 → Type u_2} [Monad m] {Struct✝ : Symbols.Repr} {S : Symbols Struct✝} {R : NatType} {k : Nat} {β : Type u_1} (trace : S.Trace R k) (init : β) (f : (i : Fin k) × R iβm (ForInStep β)) :
                                    m β

                                    Used to instantiate ForIn.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      instance Cvc.Symbols.Trace.instForInSigmaFinVal {m : Type u_1 → Type u_2} {Struct✝ : Symbols.Repr} {State : Symbols Struct✝} {R : NatType} {k : Nat} :
                                      ForIn m (State.Trace R k) ((i : Fin k) × R i)
                                      Equations
                                      def Cvc.Symbols.Trace.foldDecM {m : Type u_1 → Type u_2} {Struct✝ : Symbols.Repr} {State : Symbols Struct✝} {R : NatType} {k : Nat} {β : Type u_1} [Monad m] (trace : State.Trace R k) (f : β(i : Fin k) → R im β) (init : β) :
                                      m β

                                      Monadic fold over trace elements with decreasing indices.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        def Cvc.Symbols.Trace.foldIncM {m : Type u_1 → Type u_2} {Struct✝ : Symbols.Repr} {State : Symbols Struct✝} {R : NatType} {k : Nat} {β : Type u_1} [Monad m] (trace : State.Trace R k) (f : β(i : Fin k) → R im β) (init : β) :
                                        m β

                                        Monadic fold over trace elements with increasing indices.

                                        Equations
                                        Instances For
                                          def Cvc.Symbols.Trace.foldDec {Struct✝ : Symbols.Repr} {State : Symbols Struct✝} {R : NatType} {k : Nat} {β : Type u_1} (trace : State.Trace R k) (f : β(i : Fin k) → R iβ) (init : β) :
                                          β

                                          Fold over trace elements with decreasing indices.

                                          Equations
                                          Instances For
                                            def Cvc.Symbols.Trace.foldInc {Struct✝ : Symbols.Repr} {State : Symbols Struct✝} {R : NatType} {k : Nat} {β : Type u_1} (trace : State.Trace R k) (f : β(i : Fin k) → R iβ) (init : β) :
                                            β

                                            Fold over trace elements with increasing indices.

                                            Equations
                                            Instances For