Repository navigation
Added:
- Diagrams (
chase_cps.viz,chase-cps view): contracts, components and
systems drawn as a web page. Refinement is nesting, a quotient is a hole
with what refines it inside, a component opens on the states of its
model (RTL through Yosys, JSON, SMV, or a controller), an environment is
drawn on the left of what it drives, and the results of the checks are
tags on the boxes, with their cores. Each result of the algebra
remembers its operands (Contract.origin).ComponentandSystem
bind contracts to implementations;System.checkchecks each
implementation and the composition against the contract of the system. The
page works offline with a local ELK (elk=,--elk);viz.from_spec
draws a specification file, aschase-cps viewdoes. load_dsl(path)reads a problem written in the domain-specific language
of CHASE (the electric power system patterns of DATE18 and FDL2024) into
a contract, named after the file (orname=). The graph of the
architecture is not part of the contract and is skipped.to_gr1(c, format="slugs" | "gr1c")writes a GR(1) contract as the input
of slugs (its structured format) or of gr1c, for users who run a GR(1)
solver themselves; for gr1c, relations with arithmetic or between
integers are written as the values that satisfy them.chase-cps viewreads SystemVerilog Assertions (.sv), writes the data
of the diagram (--format json), and draws the structure only
(--no-checks); with--serve, the page takes each new drawing in place
and keeps its view, and keeps the last diagram when the file cannot be
drawn. The explanations of the page show in the webview of an editor too.chase-cps view --checkchecks that the assumptions and the guarantees
of each contract can hold together (A∧G, with the core in red when they
cannot), and the refinements, implementations, and environments drawn.
The results are kept next to the file (FILE.results.json, readable
JSON), found by a hash of what each check reads: a check of contracts that
have not changed is not run again, and a diagram drawn without checks
shows the results kept.--budgetlimits the time of the checks.- A part not written yet (the contract of a system with some outputs that
none of its parts drives) is drawn as a hole: the quotient of the
contract by the parts. chase-cps viewputs the contracts of a file together by their ports,
as Lingua Franca does: an output and an input of the same name are wired,
contracts with the same ports are versions of one part (the first one is
wired), and a contract whose outputs several parts drive has them drawn
inside it, its refinement checked with--check(and on save in an
editor). The MCP toolvisualizechecks these refinements by default.chase-cps view --implementation MODEL Cdraws C as a component with
its model (SMV, JSON, or RTL read with Yosys), checked with--check; a
Verilog or SystemVerilog file with no assertions is drawn as its module.
The options ofviewcan be written at the top of the file
(# view: ...,// view: ...in Verilog). The page saves the diagram as
SVG, PNG, or PDF, and in an editor a double click on a box, or on a term
(of a core, for instance), goes to its line in the file.- RTL read with Yosys finds the files named by
`includenext to the
sources, not only.svhand.vhheaders. chase-cps viewof a Verilog module that uses modules of other files
takes the files next to it that have them.- The checks keep their results on the contracts they check, with what the
contract said then (Contract.checked()): a diagram draws them with no
checks=, and drops them when the contract changes. - A name that is not declared in a specification file is reported with
its contract and its line. viz.diagram(..., open=[...])andchase-cps view --opendraw boxes open
when the page loads: the terms of a contract, the states of a small
model, and the core of a check that fails.
Changed:
- Demos: AIAgents is now PaymentAssistant; DATE18 and DATE21 use slugs
instead of gr1c;DATE18/eps.pychecks the power system in Python; the
READMEs show each step with its diagram, as the website does. ensureof a contract without assumptions keeps its terms: (true, G and
the new guarantee), the same contract as before, instead of the saturated
formulas of the composition.
Fixed:
- A copy of a temporal formula lost its interval, so an operation of the
console (compose, for instance) turnedG[0,2] pintoG p. - The console commands
stlandsynthesizecrashed without a contract,
or with the name of no contract. synthesize C file gr1cwrote a broken file when a relation compares
two variables or has arithmetic, which gr1c cannot read; it now writes
nothing and says to useto_gr1(c, format="gr1c").R(release) in a specification file crashed the parser of logics_tool
(exit code 134 or 138): it built onlyU.- The interval of a temporal operator in a specification file
(G[0,3] p,x U[1,2] y) was dropped, soG[0,3] pwas read as
G p. The Python package now unfolds it intoX, and refuses an
interval that is not a range of whole steps, andX[a,b]. - A probability,
P(...), now gives the name of the contract and says
that probabilities are not checked, instead of a traceback. - A negative constant (
w >= -0.8,n > -3) made the operations computed
by the C++ library (composition without discharge, for instance) fail
with "Invalid number format": the logics language reads-0.8as one
token and rejects it. The formulas are now written with(0 - 0.8).