REPROSEC / dolev-yao-star-extrinsic

DY* with extrinsic proofs
https://reprosec.org/
Mozilla Public License 2.0
10 stars 0 forks source link

Rework the trace API #61

Open TWal opened 1 month ago

TWal commented 1 month ago

As noted by the comments in #55, there is some friction associated with the trace API.

Here is a list.

The length function on traces is shadowed by the length function on bytes, so that we need to namespace it, either by doing DY.Core.Trace.Type.length or by doing module T = DY.Core.Trace.TypeT.length. We could rename it to trace_length to simplify things. https://github.com/REPROSEC/dolev-yao-star-extrinsic/blob/9c8d4d8d300755ea6d338c8afd147ff27ba1fa24/src/lib/utils/DY.Lib.Printing.fst#L250

The DY user never has to use Snoc because the trace API takes care of that. However the DY user has to use Nil because there is no empty_trace function. https://github.com/REPROSEC/dolev-yao-star-extrinsic/blob/9c8d4d8d300755ea6d338c8afd147ff27ba1fa24/examples/iso_dh/DY.Example.DH.Debug.fst#L66

In NSL but also in the lemmas about mk_rand, we use a property on traces that the last event is some RandGen event. We could factorize this in a trace predicate. https://github.com/REPROSEC/dolev-yao-star-extrinsic/blob/9c8d4d8d300755ea6d338c8afd147ff27ba1fa24/src/core/DY.Core.Trace.Manipulation.fst#L257-L258

TWal commented 1 month ago

Proposed actions:

Rename DY.Core.Trace.Type.length to trace_length.

Add val empty_trace: trace

Add val rand_just_generated: trace -> bytes -> prop

qaphla commented 1 month ago

I support this overall, and would also propose a few related actions to consider: