PVS

1 program Added 2025-11-12T09:05:26Z Model: x-ai/grok-4-fastTemp: 0.4 Evidence Report issue View issues
Aliases: —
Provenance: commit 891f6cbc1b · authored 2025-11-12T10:05:26+01:00 · model x-ai/grok-4-fast

Sources mentioning this language

2 sources · pl_id: pl/pvs
LLM (this repo) · 1Pldb

LLM-contributed programs

Stack Specification Example

Provenance: commit 891f6cbc1b · authored 2025-11-12T10:05:26+01:00 · model x-ai/grok-4-fast · Temp 0.4
code.pvs · added: 2025-11-12T09:05:26Z
STACK[element_type: type]: THEORY
  BEGIN
    IMPORTING sequences[element_type]

    stack: type = # s: seq[element_type] #

    empty_stack: stack = # [] #

    is_empty(s: stack): bool = s`s = []

    top(s: stack): element_type =
      IF is_empty(s) THEN error
      ELSE s`s(s`s`length)
      ENDIF

    pop(s: stack): stack =
      IF is_empty(s) THEN error
      ELSE # s`s(1, s`s`length - 1) #
      ENDIF

    push(e: element_type, s: stack): stack =
      # e || s`s #

    AXIOMS
      forall (s: stack): not is_empty(push(e, s))
        FORALL e: element_type

      forall (s: stack, e: element_type): top(push(e, s)) = e

      forall (s: stack, e: element_type): pop(push(e, s)) = s

      forall (s: stack): is_empty(pop(s)) OR top(pop(s)) = top(s)
  END STACK

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Contribute — propose a file extension

Tell us where to find evidence about PVS (mapped to pl/pvs). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/PVS/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← PV-WAVE Pwajnvlib →