Verified Commit a68ad347 authored by james's avatar james
Browse files

initial commit

parents
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+2 −0
Changes for .gitignore: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
/.build/
__pycache__/

Encoding.thy

0 → 120000
+1 −0
Changes for Encoding.thy: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
src/Encoding.thy
 No newline at end of file

Machine.thy

0 → 120000
+1 −0
Changes for Machine.thy: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
src/Machine.thy
 No newline at end of file

Makefile

0 → 100644
+18 −0
Changes for Makefile: 18 added lines, 0 removed lines.
Original line number Diff line number Diff line
ISABELLE ?= isabelle

.PHONY: all check clean

all: .build/ready

.build/ready: ROOT $(wildcard src/*.thy tests/*.thy) cli/driver.ML Makefile
	@test "$$('$(ISABELLE)' version)" = Isabelle2026 || { printf '%s\n' 'span requires Isabelle2026' >&2; exit 1; }
	"$(ISABELLE)" build -D . -j 1 -o threads=1 -o parallel_proofs=0
	"$(ISABELLE)" export -n -d . -O .build -x 'Span.Export:code/span.ML' Span
	SPAN_ROOT="$(CURDIR)" "$$('$(ISABELLE)' getenv -b POLYML_HOME)/$$('$(ISABELLE)' getenv -b ISABELLE_PLATFORM64)/polyc" -o .build/span cli/driver.ML
	@touch $@

check: all
	python3 tests/cli.py

clean:
	rm -rf .build

README.md

0 → 100644
+15 −0
Changes for README.md: 15 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Span

Span implements a branch relaxing assembler in Isabelle/HOL, with proofs of termination, minimum layout size and execution correspondence for a bytecode machine with signed 8-bit and 16-bit relative branches

[![](media/demo.gif)](media/demo.mp4)

## Correctness

An overflowing short branch must be wide in every valid assignment. [Relaxation](Relax.thy) computes the least widening set terminating on the number of remaining short branches. A final range check decides whether any valid layout exists

[Encoding](Encoding.thy) proves byte bounds and decoder inversion and [Execution correspondence](Machine.thy) relates source execution `S` and bytecode execution `B` through relocation `R` for every fuel bound (including suspended states)

![](media/correspondence.svg)

Minimality assumes fixed instruction order and excludes alignment directives while the machine uses a natural valued accumulator and biased little endian branch payloads. The execution theorem starts from resolved instructions and excludes the SML compiler, runtime and OS I/O
Loading