lf-lang / reactor-model Goto Github PK
View Code? Open in Web Editor NEWA Lean-based formalization of the Reactor model.
License: Apache License 2.0
A Lean-based formalization of the Reactor model.
License: Apache License 2.0
On branch physical
.
I think we can more or less easily extend the formalization with physical actions.
We will probably need to:
Component.phy
(and rename Component.act
to Component.log
).Execution.State
.Can we still show execution to be deterministic if the physical actions occur at the same wall clock times across executions?
cf. Marten's dissertation page 67
... as a mutually inductive definition of:
I think it might be realistic to attempt connecting (a rewritten version of) the Lean target with this formalization.
The target's reactor type would be shown to conform to Reactor.Proper
. The target's runtime can probably be implemented such that we have a function time
for a time step, a function skip
for a skip step and a function exec
for an execution step, with them being combined into a single step
function which determines which step to take and calls it. We would then need to prove something like ∀ s, s ↓ (step s)
. Note that this is just an implication and not an equivalence because it captures the notion of refinement. That is, the concrete implementation of the Lean target does not have to (and in fact can't) support all non-deterministic step choices allowed by the Reactor model. Note that this whole approach probably works only when all reactions in the system are pure, i.e. do not support IO
.
To then connect with the transitive step relation, we could perhaps define a bounded run function that takes the maximum number of steps as input. Then we would try to prove ∀ n s, s ⇓ (boundedrun n s)
.
I think to perform the steps outlined above, we would need to adjust the formalization in the following ways:
ID
and Value
type parameters in or on Reactor
. Note that when showing that the Lean target's reactor type conforms to Reactor
we would probably set the ID
type to be the sum type of all target-native ID-types and the Value
type to be the type Σ type : Type, type
.Reaction
a type class instance with Priority
as a type parameter in or on it.Execution.State
a type class.Time
and Time.Tag
a type class.Note that if you combine the Lean target and the formalization, you can use all of the types declared in the formalization as part of the implementation. But if you want to use a different type for the implementation, you need to have the formalization use a type class for it.
In Mathlib.lean
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.