Comments (1)
Hi Cornelius,
Thanks for your interest in AutoCorres!
You are right that AutoCorres does not make any attempt to abstract C arrays to more user-friendly HOL types. It might be possible to do something sensible with C arrays, but it's not something we've thought about yet.
I can foresee some difficulties, however. C arrays are barely distinguishable from pointers in common usage. Any well-founded HOL abstraction of an array is going to need to know where to find the end of the array. Unfortunately, that information is lost as soon as you pass an array as a pointer.
At least for now, this means that it is up to the AutoCorres user to assert that particular pointers are arrays of particular lengths and particular contents, and to carry these assertions through the broader development.
You are also right that it ought to be possible to provide a library of predicates with which an AutoCorres user can assert a correspondence between a C array and a HOL data type, together with lemmas which explain how common C array manipulations correspond to operations on the corresponding HOL data type. Again, we just haven't spent much time on this aspect, so what you see is a collection of minimal examples rather than a comprehensive library.
Note that there might be many different ways you might want to abstract an array, depending on how you actually intend to use the array in C! Sometimes, you might want a list, sometimes a set, sometimes a partial function. Sometimes you might not want to abstract at all, because you just want to allocate a region of bytes in which to do horrible things with pointers and casts!
The main achievements of AutoCorres so far are:
- Automatically producing a shallowly-embedded abstraction (as a nondeterministic state monad) from a deeply-embedded low-level representation of the C code (in Schirmer's SIMPL language), together with a proof of refinement.
- Automatically abstracting a low-level byte-array representation of the C heap to a split heap, which makes it easier to reason about pointers to C structures.
- Automatically abstracting signed and unsigned word variables to HOL int and nat types.
- Optimisations which often make the abstract representation significantly simpler than the low-level SIMPL.
I'll think about whether we can clarify the intent of the examples. We would welcome your suggestions. In the meantime, I hope this is of some help!
Regards,
Matthew
from l4v.
Related Issues (20)
- simpler `corres` and `corressimp` methods HOT 10
- investigate parallelising the haskell translator
- does `ccorres` need a `corres_cases` equivalent?
- should `corres_cases` also do case distinction on `if`?
- Cannot load theory file "l4v/proof/crefine/autocorres-test/Refine_C.thy" HOT 4
- Investigate adding `projectKOs` to the simp set HOT 1
- Remove instances of `UNIV <\inter>` from CRefine
- Cleanup CRefine Wellformed_C
- Cleanup post-x64 comments
- Document mysterious useful comments for ctac and ceqv
- SIMPL: don't print `_'proc`
- CI artifact upload uses clashing artifact names
- Methods such as monadic_rewrite_symb_exec_r should warn that discharging side-conditions failed
- Safer vcg in CRefine
- Sub-term to free variable lifting tactic
- Have wp warn when resulting in a goal with a schematic assumption. HOT 15
- Some way of blocking `simp` from unifying schematics HOT 1
- Decide on style for `[def]rule_tac ... [and ...] in ...` HOT 7
- Investigate further use of `none_top/none_bot` in the proofs
- Enhance C Parser to allow named array bounds 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 l4v.