Transition systems and bounded model checking, typed #
A Sys is a transition system over a symbol structure of state variables (see structure.symbols):
an initial predicate, a transition relation between a state and the next, and named candidate
invariants. Sys.Bmc checks the candidates on runs of increasing length.
Sys.Bmc.mk sys starts at step 0. check looks for a run whose state at the current step
falsifies some remaining candidates: it answers their names and the checker without them, the
counterexample recorded in falsified, or none once no remaining candidate can be falsified at
this step. unroll then moves to the next step.
Runs f on each step's value, from step 0 up to step k.
Equations
- Cvc.Typed.Sys.Trace.iterM f (Cvc.Typed.Sys.Trace.zero val) = f val
- Cvc.Typed.Sys.Trace.iterM f (Cvc.Typed.Sys.Trace.cons val tl) = do Cvc.Typed.Sys.Trace.iterM (fun {k : Nat} => f) tl f val
Instances For
The value at step k, the last one.
Equations
- (Cvc.Typed.Sys.Trace.zero val).getCurrent = val
- (Cvc.Typed.Sys.Trace.cons val tl).getCurrent = val
Instances For
The value at step 0.
Equations
- (Cvc.Typed.Sys.Trace.zero val).getZero = val
- (Cvc.Typed.Sys.Trace.cons val tl).getZero = tl.getZero
Instances For
A trace of unrolled Term-symbols.
Equations
Instances For
A trace of Lean-values for some unrolled symbols.
Equations
Instances For
A trace of Term-values for some unrolled symbols.
Equations
Instances For
Extracts the Lean-values of a TermTrace.
Equations
- Cvc.Typed.Symbols.Sig.ValueTrace.extract (Cvc.Typed.Sys.Trace.zero terms) = Cvc.Typed.Sys.Trace.zero <$> terms.getValues s
- Cvc.Typed.Symbols.Sig.ValueTrace.extract (Cvc.Typed.Sys.Trace.cons terms tl) = do let values ← terms.getValues s Cvc.Typed.Sys.Trace.cons values <$> Cvc.Typed.Symbols.Sig.ValueTrace.extract tl
Instances For
Extracts the Lean-values of a TermTrace.
Instances For
Extracts the Lean-values of a TermTrace.
Instances For
Extracts the Term-values of a TermTrace.
Equations
- One or more equations did not get rendered due to their size.
- Cvc.Typed.Symbols.Sig.ValueTermTrace.extract (Cvc.Typed.Sys.Trace.zero terms) = Cvc.Typed.Sys.Trace.zero <$> terms.getValueTerms s
Instances For
Extracts the Term-values of a TermTrace.
Equations
Instances For
Extracts the Term-values of a TermTrace.
Equations
Instances For
A transition system over the state variables SVars, with candidate invariants to check.
- idents : SVars.Idents
State variable identifiers.
- init : SVars.PredAt'
Initial predicate over
SVars. - next : SVars.RelAt'
Transition relation over
SVars. - candidates : Symbols.Sig.Candidates
Candidate properties over the system.
Instances For
Equations
Instances For
Declares step k's state variables in solver, and answers the initial predicate on them.
Equations
- Cvc.Typed.Sys.initAt sys solver k = do let svs_k ← Cvc.Typed.Solver.declareSymbolsAt k solver sys.idents sys.init svs_k
Instances For
The transition relation from the state curr to the state next.
Equations
- Cvc.Typed.Sys.nextAt sys curr next = sys.next curr next
Instances For
Bounded model checking of a system, unrolled to step k.
- mk' :: (
- idents : SVars.Idents
The system's state variables.
The transition relation, at this scope.
The candidate invariants not falsified yet, at this scope.
- solver : Solver
The solver the steps are asserted in.
- sVars : Symbols.TermTrace k
The state variables of every step so far.
The counterexamples found, latest first: each one's step, trace and falsified candidates.
- )
Instances For
A checker for sys at step 0, on a new solver asserting the initial predicate.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Whether every candidate has been falsified.
Equations
- Cvc.Typed.Sys.Bmc.isDone bmc = bmc.candidates.isEmpty
Instances For
Looks for a run whose state at the current step falsifies some remaining candidates.
Answers their names and the checker without them, the counterexample added to falsified, or
none if no remaining candidate can be falsified at this step. Call it until it answers none.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Moves to the next step: declares its state variables and asserts the transition into it.
Equations
- One or more equations did not get rendered due to their size.