Comments (4)
How to encode coverage constraints for Filament's linearity check?
For example:
bundle a{#K+1};
a{0} = 20
for #i in 0..#K-1 {
a{#i+1} = 30
}
a{#K} = 10
The following asks whether there is any point that is not any of these indices:
exists #p.
#p \in [0, K] /\ -- (1)
(
!(#p == 0) \/ -- (2)
!(#p >= 1 /\ #p < K) \/ -- (3)
!(#p == #K) -- (4)
)
Constraints are:
#p
is a valid index into the bundle#p
is not{0}
which is written to in the first write#p
is not in the range implied by[0, K-1)
incremented by 1 because of the#i+1
expression- It's not clear how to support
a{2*#i}
or other expressions which don't generate continuous sets.
- It's not clear how to support
- Same as (1)
Since p
is implicitly existentially quantified, we can just ask the solver to provide a model and there is a model, then we've found an index that is not assigned to.
from filament.
Another approach is using forall
(😭 ):
exists #p.
#p \in [0, K] /\ -- (1)
(
#p != 0) \/ -- (2)
(forall #i.
#i >= 0 /\ #i < K-1 /\ #p != #i+1) -- (3)
\/
#p != #K -- (4)
)
While annoying, this does get around the problem of dealing with complex indexing expressions like 2*#i
. The final approach is making this a best effort check and leave it to monomorphization to track if all locations in a bundle are assigned to.
from filament.
Subsumes #46
from filament.
Much like #85, this is not strictly required for Filament's type soundness guarantees. The type soundness guarantee only holds if all the ports are linearly assigned. However, I think it makes sense to keep this around if not for parametric modules then at least as a elaboration check
from filament.
Related Issues (20)
- Current website formatting doesn't meet WCAG text accessibility guidelines HOT 1
- Build docker container for all ADL tools HOT 2
- Generic bundle transformers
- Cleanup deadline code
- Shortform syntax for external parameter access HOT 1
- Unused variable warning
- BLAS evaluation HOT 1
- Partial Streaming FFTs HOT 3
- ASIC Flows for Evaluation HOT 2
- Instance borrow syntax should support references to instance's existential parameters HOT 4
- Bundle assignments of same length HOT 1
- Add a way to specify global values used in the gen framework
- No longer testing against rust panic messages
- Removing reliance on calyx dockerfile
- If-expressions for parameters HOT 1
- Providing parameters to `main` component on compilation. HOT 3
- Externally-provided parameters HOT 4
- Extend assert syntax HOT 1
- Better error message for `attempt to subtract with overflow` HOT 1
- Higher order Filament HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from filament.