Skip to content
STIMSMITH

execVAMP function

CodeArtifact WIKI v1 · 5/25/2026

The execVAMP function is a lifting of exec_instr into the state-exception monad used in test specifications for generated VAMP instruction sequences. It executes a VAMP instruction against a machine state by returning a successful monadic result containing unit and the state produced by exec_instr.

Overview

execVAMP is defined in the VAMP microprocessor testing case study as a lifted execution function for VAMP instructions. The paper describes it as “a lifting of exec_instr into the state exception monad” and gives the definition:

definition execVAMP where execVAMP ≡ (λ i σ. Some ((), exec_instr σ i))

In this definition, i is an instruction and σ is the input state. The function returns Some ((), exec_instr σ i), i.e. a successful state-exception-monad result with no meaningful local return value and with the next state computed by exec_instr.

Role in sequence test specifications

The case study uses execVAMP in sequence-oriented test specifications over generated instruction lists ιs :: instr list. The paper distinguishes scenarios that observe local execution steps from scenarios that test the final state; for this application, local steps are not relevant because they are “just actions not reporting a computation result.” Instead, the specifications execute an instruction sequence and then assert a property over the resulting state.

One whole-state conformance pattern is shown as:

test_spec pre ιs::instr list =⇒
  (σ0 |= (_ ← mbind ιs execVAMP;
          assertSE (λσ. σ =k SUT σ0 ιs)))

A more focused pattern compares only register 0 after appending a load instruction:

test_spec pre ιs::instr list =⇒
  (σ0 |= (_ ← mbind (ιs@[load x 0]) execVAMP;
          assertSE (λσ. (gprs σ)!0 = (gprs (SUT σ₀ ιs))!0)))

In both patterns, mbind applies execVAMP across the instruction sequence starting from the initial state σ0, and assertSE checks the final-state property.

Testing context

The same source explains that the test specification preconditions, also called test purposes, restrict generated instruction sequences to a chosen subset. The authors chose an empty initial configuration σ0 for their study and proved it well formed, rather than generating arbitrary initial configurations that might be ill formed in the abstract assembler model.

The testing work is positioned at the design level of the VAMP machine rather than at the available VAMP gate-level model. In the load-store testing example, the test purpose is_load_store restricts instruction generation to load/store operations by syntactic constraints over the VAMP assembly language.

CITATIONS

8 sources
8 citations
[1] execVAMP is defined as a lifting of exec_instr into the state-exception monad. Test Program Generation for a Microprocessor: A Case Study
[2] The formal definition of execVAMP is λ i σ. Some ((), exec_instr σ i). Test Program Generation for a Microprocessor: A Case Study
[3] execVAMP is used with mbind to execute generated instruction sequences in final-state test specifications. Test Program Generation for a Microprocessor: A Case Study
[4] The relevant test scenarios in the case study assert properties over the final state rather than observing local execution steps. Test Program Generation for a Microprocessor: A Case Study
[5] Test specification preconditions are also called test purposes and restrict generated instruction sequences to a selected subset. Test Program Generation for a Microprocessor: A Case Study
[6] The study uses an empty initial configuration σ0 that is proved well formed. Test Program Generation for a Microprocessor: A Case Study
[7] The testing work stays at the design level of the VAMP machine, despite the availability of a VAMP gate-level model. Test Program Generation for a Microprocessor: A Case Study
[8] The is_load_store test purpose restricts the first test scenario to load and store operations by constraints over VAMP assembly syntax. Test Program Generation for a Microprocessor: A Case Study