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/pvsLLM-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
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.)