recife (TLA+/TLC) model-check adapter.
Stratified: pure promoters (trace->status, the violation rule-chain) ->
pure pipeline (normalize a raw recife result into a ModelCheckResult) ->
effectful boundary (check!, which runs a model through an INJECTED effect fn;
the default lazily resolves recife via requiring-resolve so this ns loads on
any classpath).
normalize maps recife's :trace discriminator to a status:
:trace :ok -> {:status :ok}
:trace [[idx state] ...] -> {:status :fail :details {:counterexample ...}}
:trace :error / other -> {:status :skip} (indeterminate; never :ok)
recife (TLA+/TLC) model-check adapter.
Stratified: pure promoters (trace->status, the violation rule-chain) ->
pure pipeline (normalize a raw recife result into a ModelCheckResult) ->
effectful boundary (`check!`, which runs a model through an INJECTED effect fn;
the default lazily resolves recife via requiring-resolve so this ns loads on
any classpath).
`normalize` maps recife's `:trace` discriminator to a status:
:trace :ok -> {:status :ok}
:trace [[idx state] ...] -> {:status :fail :details {:counterexample ...}}
:trace :error / other -> {:status :skip} (indeterminate; never :ok)(build-counterexample {:keys [trace trace-info]})Build a CounterexampleTrace from a recife result whose :trace is a counterexample vector of [idx state] pairs (index dropped, as recife.helpers/get-trace does).
Build a CounterexampleTrace from a recife result whose :trace is a counterexample vector of [idx state] pairs (index dropped, as recife.helpers/get-trace does).
(check! model-spec)(check! model-spec run-fn)(check! model-spec opts run-fn)Model-check model-spec, returning a normalized ModelCheckResult. The effect
is INJECTED: run-fn maps the model spec and run options to a raw recife
result (default: default-runner). Options default to the spec's :opts map.
recife-absent, nil, or a non-map result normalize to :skip, never a pass.
Model-check `model-spec`, returning a normalized ModelCheckResult. The effect is INJECTED: `run-fn` maps the model spec and run options to a raw recife result (default: `default-runner`). Options default to the spec's :opts map. `recife-absent`, nil, or a non-map result normalize to :skip, never a pass.
(classify-violation trace-info)(classify-violation trace-info rules)Classify a recife trace-info map as a :safety or :liveness refutation by folding the ordered rule-chain (first match wins). OCP: add a rule, not a branch. Total on the default chain (the terminal rule matches everything).
Classify a recife trace-info map as a :safety or :liveness refutation by folding the ordered rule-chain (first match wins). OCP: add a rule, not a branch. Total on the default chain (the terminal rule matches everything).
Ordered violation rules; first match wins. A temporal (liveness) refutation surfaces as a :back-to-state or :stuttering violation; a deadlock is reported as itself rather than folded into :safety, because no property the caller wrote was refuted by it; a bare finite counterexample with no such marker is a safety (invariant) violation.
Ordered violation rules; first match wins. A temporal (liveness) refutation surfaces as a :back-to-state or :stuttering violation; a deadlock is reported as itself rather than folded into :safety, because no property the caller wrote was refuted by it; a bare finite counterexample with no such marker is a safety (invariant) violation.
(default-runner {:keys [init-state components] :as model-spec})Effect fn: run model-spec through recife, returning its raw result and the
absolute path to generated spec.tla, or recife-absent when recife is
unresolvable. :opts are passed directly to run-model as its third argument.
Effect fn: run `model-spec` through recife, returning its raw result and the absolute path to generated spec.tla, or `recife-absent` when recife is unresolvable. `:opts` are passed directly to run-model as its third argument.
A rule classifying a recife trace-info map as a safety/liveness refutation.
A rule classifying a recife trace-info map as a safety/liveness refutation.
(-match? rule trace-info)True iff this rule handles trace-info.
True iff this rule handles `trace-info`.
(-violation-class rule)The violation-type keyword this rule assigns.
The violation-type keyword this rule assigns.
(normalize raw)Normalize a raw recife result into a ModelCheckResult. Errors and indeterminate traces are :skip, never :ok. A generated :spec.tla location is carried in :details under :spec-path.
Normalize a raw recife result into a ModelCheckResult. Errors and indeterminate traces are :skip, never :ok. A generated :spec.tla location is carried in :details under :spec-path.
Sentinel a runner returns when recife/TLC is not on the classpath.
Sentinel a runner returns when recife/TLC is not on the classpath.
(recife-trace->status trace)Map a recife result's :trace value to a normalized status. A non-empty vector is a counterexample (:fail); :ok is clean; anything else (:error, nil, empty) is indeterminate (:skip).
Map a recife result's :trace value to a normalized status. A non-empty vector is a counterexample (:fail); :ok is clean; anything else (:error, nil, empty) is indeterminate (:skip).
(rule match-fn klass)A violation rule from a predicate on trace-info and a violation-type.
A violation rule from a predicate on trace-info and a violation-type.
Keys accepted by recife.core/run-model and passed through its options map.
Keys accepted by recife.core/run-model and passed through its options map.
(tlc-opts model-spec)Pure: the recife run-model opts map for model-spec. Keeps run-model's
supported options, drops nil values and an empty :tlc-args, and normalizes
:tlc-args to a vector of strings. A spec with no :opts yields {}.
Pure: the recife run-model opts map for `model-spec`. Keeps run-model's
supported options, drops nil values and an empty :tlc-args, and normalizes
:tlc-args to a vector of strings. A spec with no :opts yields {}.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |