formal

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package formal lints the TLA+ models under hack/formal for the mistakes that make a model check pass for the wrong reason.

Every check here exists because that mistake produced a false green while these models were being written:

unassigned-variable   A variable no action assigns. TLC reports it as
                      "Successor state is not completely specified", but only
                      on the paths it explores, and any rule over such a
                      variable is vacuously true. An entire gate rule was
                      silently vacuous this way.
duplicate-assignment  The same variable assigned twice in one branch. TLA+
                      conjoins them, so a contradicting assignment can never
                      fire. This hid the ordering bug the /goal model exists
                      to find.
assigned-and-unchanged A variable both assigned and listed in an UNCHANGED
                      tuple pins it twice. A bulk edit made every action in
                      the session model unsatisfiable this way, and the run
                      explored two states while reporting success.
vacuous-rule          A rule whose premise needs a literal no action produces.

The lint is branch-aware: THEN/ELSE and a leading \/ start separate branches, so an action that differs per branch is not read as a contradiction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finding

type Finding struct {
	File   string
	Action string
	Rule   string
	Kind   string
	Detail string
}

Finding is one structural problem in one spec. String renders it the way the command prints it, so a caller that logs findings and a caller that compares them see the same text.

func Lint

func Lint(file, src string) []Finding

Lint checks one spec's source text and returns its findings. file is used only for messages.

func LintDir

func LintDir(root string) ([]Finding, int, error)

LintDir lints every .tla under root, in sorted order.

func (Finding) String

func (f Finding) String() string

Directories

Path Synopsis
Command lint reports structural defects in the TLA+ models under hack/formal.
Command lint reports structural defects in the TLA+ models under hack/formal.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL