You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when we have many case splits, and an intermediate struct holding a state, we are in a situation like below:
struct S {
...
x : if ??? then T else Data<adv>
...
}
def foo() @ L : Option S = {
... many case splits ...
in
Some(S(..., x, ...))
}
where it is quite tricky to find out what ??? should be.
Currently, the strategy for doing so is as follows:
Instead of returning a value of type S at the end of the function, return a value of type Unit;
Use --log-typecheck to log all of the different case splits;
Insert the following debug command just before returning:
debug hasType(x, T);
debug hasType(x, Data<adv>);
This will output a trace similar to below:
Case split: is_e_init<>[msg1_ephemeral']
Case split: [S_resp<@m>] <= adv
Case split: [E_init<i@n>] <= adv
Case split: [S_init<@n3>] <= adv
Case split: n =idx n3
C3 has type Name(ODHName<L2<@n,m>;0>(C2, 0x)[0]): False
C3 has type Data<adv>: True
Case split: n !=idx n3
C3 has type Name(ODHName<L2<@n,m>;0>(C2, 0x)[0]): False
C3 has type Data<adv>: True
Case split: [S_init<@n3>] !<= adv
Case split: n =idx n3
C3 has type Name(ODHName<L2<@n,m>;0>(C2, 0x)[0]): False
C3 has type Data<adv>: True
...
After obtaining this trace, I can manually deduce what ??? is by minimizing the trace, similar to a BDD. It would be really great if we could automate this process.
The text was updated successfully, but these errors were encountered:
Currently when we have many case splits, and an intermediate struct holding a state, we are in a situation like below:
where it is quite tricky to find out what
???
should be.Currently, the strategy for doing so is as follows:
S
at the end of the function, return a value of typeUnit
;--log-typecheck
to log all of the different case splits;This will output a trace similar to below:
After obtaining this trace, I can manually deduce what
???
is by minimizing the trace, similar to a BDD. It would be really great if we could automate this process.The text was updated successfully, but these errors were encountered: