Comments (7)
RE: Num (a, b) vs. Num a b, Let's do whatever Coq.Ascii does.
Looks like Ascii is defined like this:
Inductive ascii : Set := Ascii (_ _ _ _ _ _ _ _ : bool).
So we could be:
Inductive num : Set := Num (_ _ : ascii).
Let's also copy Ascii on low/high, which is least significant first:
Coq < Eval cbv in (nat_of_ascii (Ascii false true true true true true true true)).
= 254
: nat
So we would be low then high.
from kraken.
Small problem:
You used to take apart a num in KrakenImpl.ml in such a way:
let int_of_num n =
Char.code (MlCoq.char_of_ascii n)
Maybe the num type used to be just an ascii and the constructor could be ignored. But now, the extracted num is:
type num =
| Num of MlCoq.ascii * MlCoq.ascii
Thus, I can't take the type apart since it doesn't exist yet... (otherwise, circular build KrakenImpl <-> Message).
There are two solutions I can think of ATM.
One is to force the extraction to a couple of asciis. This way, no "Num" constructor problem...
Another is to resolve the circularity somehow. For instance, defining the num type in KrakenImpl.ml, and axiomatizing it in Message.v, or something...
What think?
from kraken.
I think your first solution is the right one for now: force extraction of Num to be a pair of Ascii values.
Would it work to just define Num as ascii * ascii ? Does it need to be a proper Inductive type?
from kraken.
A bit stuck on recv_msg.
It used to create goals like these:
subgoal 2 is:
forall v : num,
hprop_unpack tr (fun tr0 : Trace => traced (RecvNum c v ++ tr0) * bound c) ==>
?1561 v
subgoal 3 is:
?1561 (Num (Ascii true true b1 b2 b3 b4 b5 b6)) ==> ?1583 * emp
subgoal 4 is:
forall v : msg,
?1583 * [v = BadTag m] ==>
hprop_unpack tr (fun tr0 : Trace => traced (RecvMsg c v ++ tr0) * bound c)
subgoal 5 is:
?1561 (Num (Ascii true false true b2 b3 b4 b5 b6)) ==> ?1599 * emp
subgoal 6 is:
forall v : msg,
?1599 * [v = BadTag m] ==>
hprop_unpack tr (fun tr0 : Trace => traced (RecvMsg c v ++ tr0) * bound c)
subgoal 7 is:
?1561 (Num (Ascii true false false true b3 b4 b5 b6)) ==> ?1615 * emp
subgoal 8 is:
forall v : msg,
?1615 * [v = BadTag m] ==>
hprop_unpack tr (fun tr0 : Trace => traced (RecvMsg c v ++ tr0) * bound c)
subgoal 9 is:
?1561 (Num (Ascii true false false false true b4 b5 b6)) ==> ?1631 * emp
subgoal 10 is:
forall v : msg,
?1631 * [v = BadTag m] ==>
hprop_unpack tr (fun tr0 : Trace => traced (RecvMsg c v ++ tr0) * bound c)
subgoal 11 is:
?1561 (Num (Ascii true false false false false true b5 b6)) ==> ?1647 * emp
For some reason, they contain very specific values of Num, I don't even know why... It looks like it is "sortof" enumerating possible values of Num in a very weird fashion...
In my case, it gets worse as it gives me unsolvable goals :(
subgoal 2 is:
traced (Recv c (Ascii true false true b2 b3 b4 b5 b6 :: a0 :: nil) :: x) ==>
traced (Recv c (a1 :: b7 :: nil) :: x)
subgoal 3 is:
traced (Recv c (Ascii true false false true b3 b4 b5 b6 :: a0 :: nil) :: x) ==>
traced (Recv c (a1 :: b7 :: nil) :: x)
subgoal 4 is:
traced
(Recv c (Ascii true false false false true b4 b5 b6 :: a0 :: nil) :: x) ==>
traced (Recv c (a1 :: b7 :: nil) :: x)
subgoal 5 is:
traced
(Recv c (Ascii true false false false false true b5 b6 :: a0 :: nil) :: x) ==>
traced (Recv c (a1 :: b7 :: nil) :: x)
subgoal 6 is:
traced
(Recv c (Ascii true false false false false false true b6 :: a0 :: nil)
:: x) ==> traced (Recv c (a1 :: b7 :: nil) :: x)
subgoal 7 is:
traced (Recv c ("129" :: a0 :: nil) :: x) ==>
traced (Recv c (a1 :: b7 :: nil) :: x)
subgoal 8 is:
traced (Recv c ("001" :: Ascii true b8 b9 b10 b11 b12 b13 b14 :: nil) :: x) ==>
traced (Recv c (a1 :: b15 :: nil) :: x)
from kraken.
P.S. Did not have such trouble when I had a Num constructor.
Maybe I should keep the constructor, and force the extraction to pairs :(
from kraken.
@Ptival is there a branch I can pull to look at this?
What do the type of Num and defn of recv_num look like now?
from kraken.
Fixed by 9c87abb
from kraken.
Related Issues (20)
- trace_impl vs. trace_spec HOT 3
- Missing handlers don't generate ValidExchange constructors HOT 3
- Impossible to use absolute paths HOT 4
- Can't use two fields of same type for a message
- spec generation when a message handler parameter affects a state variable
- KInvariant quantifies same variable twice HOT 2
- old branches HOT 3
- Same name for variable names of same type HOT 1
- Need to update the C libs to handle bigger nums
- Running tests takes too long
- msg logging improvements HOT 1
- hardcoded vars
- prefix lib names
- ImmBefore/After encoded in regular expression HOT 1
- updating chans in handlers does not work HOT 8
- Missing case in ktm_basic
- C msg lib does not log
- SSH 3 Login Trial Policy failed
- improve parser error reporting
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 kraken.