Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
f7707f3
pts_to_parsed
tahina-pro Mar 16, 2026
90ef511
Add LowParse.PulseParse.* combinators for non-injective parsers
tahina-pro Mar 16, 2026
d1fbdd0
Port Low validators to Pulse PulseParse combinators
tahina-pro Mar 17, 2026
fae9d95
Add peek_trade_gen to PulseParse.Base
tahina-pro Mar 17, 2026
25e9b14
WIP PulseParse enum, sum (1 admit)
tahina-pro Mar 17, 2026
33d29cf
Implement validate_sum_aux in PulseParse.Sum
tahina-pro Mar 17, 2026
36acfc0
Implement validate_sum in PulseParse.Sum
tahina-pro Mar 17, 2026
1c91ec4
Port BitSum validators from Low* to Pulse
tahina-pro Mar 17, 2026
753d444
Port validate_dsum to PulseParse.Sum
tahina-pro Mar 17, 2026
b0d4607
Port validate_ifthenelse to PulseParse
tahina-pro Mar 19, 2026
977f01d
Port validate_list_up_to to PulseParse
tahina-pro Mar 19, 2026
33a601b
Add leaf_reader conversion between PulseParse and Pulse
tahina-pro Mar 19, 2026
aed125c
Port validate_bcvli and validate_bounded_bcvli to PulseParse
tahina-pro Mar 19, 2026
2e9024a
Port BoundedInt constant-size validators to PulseParse
tahina-pro Mar 19, 2026
c5a02b7
Port all BoundedInt validators to PulseParse
tahina-pro Mar 20, 2026
1318fd6
Add generic and dispatcher BoundedInt validators
tahina-pro Mar 20, 2026
bf6856c
Add remaining FLData validators to PulseParse
tahina-pro Mar 20, 2026
c0aa23f
Add remaining VLData validators to PulseParse
tahina-pro Mar 20, 2026
d5b45eb
Port VLGen, Bytes, and Array validators to PulseParse
tahina-pro Mar 20, 2026
710c584
Port validate_deplen to Pulse
tahina-pro Mar 20, 2026
db4c20f
Port Int, ConstInt32, Int32le, and DER validators to Pulse
tahina-pro Mar 20, 2026
875c417
Port Low* jumpers to Pulse/PulseParse modules
tahina-pro Mar 20, 2026
823799d
Set up Pulse LowParse test infrastructure
tahina-pro Mar 23, 2026
0ef6cbc
Port zero_copy_parse combinators to PulseParse
tahina-pro Mar 23, 2026
c43a399
Port Low* accessors to PulseParse zero_copy_parse equivalents
tahina-pro Mar 23, 2026
bfa6a17
Port LowParseExample3 test to Pulse
tahina-pro Mar 23, 2026
dc18c45
Use zero_copy_parse accessors in Example3 Pulse test
tahina-pro Mar 23, 2026
75aaa6f
Use let mut for poffset in Example3 test
tahina-pro Mar 23, 2026
1edffca
Add test and main functions to Example3 Pulse test
tahina-pro Mar 23, 2026
3ee56b3
Rename test to LowParseExample3, add extraction + run
tahina-pro Mar 23, 2026
e593dce
Use Int32.t return for main instead of C.exit_code
tahina-pro Mar 23, 2026
216c7ee
Strip main arguments — KaRaMeL handles argless main
tahina-pro Mar 23, 2026
0542c3f
Port LowParse tests to Pulse
tahina-pro Mar 23, 2026
76a8397
Remove LowParseExampleEnum — SLow-only example, not relevant for Pulse
tahina-pro Mar 24, 2026
b6c37ba
Fix Example8: add full Pulse validators/jumpers using dep_enum_destr_tac
tahina-pro Mar 24, 2026
b2ecbb8
Add Example9 dsum validators + jump_compose_context combinator
tahina-pro Mar 24, 2026
1c12cb6
Example9: document KaRaMeL extraction limitation for dsum validators
tahina-pro Mar 24, 2026
ea71cf4
Fix Example9: use dep_maybe_enum_destr_t_tac for dsum dispatch
tahina-pro Mar 24, 2026
25007c4
Add validate_dsum_cases/jump_dsum_cases (no prime) to PulseParse.Sum
tahina-pro Mar 24, 2026
7ea3d32
Remove duplicate validate_synth from PulseParse.Combinators
tahina-pro Mar 24, 2026
83da423
Replace unrestricted norm [delta] with delta_only in Example9.Aux
tahina-pro Mar 24, 2026
8147a49
Fix Example9 extraction: Pulse fn + dep_maybe_enum_destr_t_tac
tahina-pro Mar 24, 2026
f41557b
Add validate_dsum_cases_fn/jump_dsum_cases_fn generic combinators
tahina-pro Mar 24, 2026
caa4f72
Port Example10 ifthenelse with U8 triple tag instead of flbytes
tahina-pro Mar 24, 2026
a4279f8
Add split_nondep_then + leaf_read_nondep_then to PulseParse
tahina-pro Mar 24, 2026
d165a57
Add ifthenelse payload accessor to Example10
tahina-pro Mar 24, 2026
df6e9cb
Add separate zero_copy_parse-style accessors to Example10
tahina-pro Mar 24, 2026
a025303
Implement PulseParse accessor type and combinators
tahina-pro Mar 24, 2026
d8e6715
Port Low* accessors to PulseParse
tahina-pro Mar 24, 2026
280364c
DSum tag accessor: document F* coercion limitation
tahina-pro Mar 24, 2026
0fbb9a2
Add parse_dsum_tag_of_data lemma and accessor_dsum_tag
tahina-pro Mar 25, 2026
9c9e60d
Port remaining 13 non-Bytes accessors to PulseParse
tahina-pro Mar 25, 2026
22a44fd
Update Pulse LowParse test ports to use PulseParse accessor type with…
tahina-pro Mar 25, 2026
27f2668
PulseParse: add accessor_ifthenelse_payload combinator (serializer-free)
tahina-pro Mar 25, 2026
9eb4a61
PulseParse: fix accessor combinator parser_kind to Ghost.erased
tahina-pro Mar 25, 2026
e138231
Erase parser_kind and nat arguments in Pulse combinators
tahina-pro Mar 25, 2026
f4252db
PulseParse: add leaf_read_bcvli, LE bounded integer readers, port Exa…
tahina-pro Mar 26, 2026
dd67428
PulseParse: add nlist_nth combinator
tahina-pro Mar 26, 2026
b8f158d
PulseParse: add accessor_nlist_nth
tahina-pro Mar 26, 2026
5f96705
PulseParse: add accessor_parser_ext
tahina-pro Mar 26, 2026
1bd7199
LowParse.Spec.VCList: add parse_vclist_dtuple2_eq lemma
tahina-pro Mar 26, 2026
a5daf5d
PulseParse: add accessor_dtuple2_snd combinator
tahina-pro Mar 26, 2026
14b84c8
Example11: rewrite read_6th using accessor combinators
tahina-pro Mar 26, 2026
b227d57
PulseParse: add accessor_vclist_payload combinator
tahina-pro Mar 26, 2026
80a2604
Example11: use accessor_vclist_payload in read_6th
tahina-pro Mar 26, 2026
fae66fe
PulseParse: add BE bounded integer readers, DER leaf_reader, port Exa…
tahina-pro Mar 26, 2026
ab7298c
PulseParse: add DepLen module, port ExampleDepLen
tahina-pro Mar 26, 2026
9a9088f
Remove LowParse.Pulse.DepLen (superseded by PulseParse.DepLen)
tahina-pro Mar 26, 2026
4db785e
Example5: replace zero_copy_parse with PulseParse accessors
tahina-pro Mar 26, 2026
0545b37
Add QD unit test to share/everparse/tests/qd/unit
tahina-pro Mar 27, 2026
74dfa2b
do not copy Test.fst, properly depend on it
tahina-pro Mar 27, 2026
b5e0cec
empty test executable
tahina-pro Mar 27, 2026
fcd4228
QuackyDucky: add -pulse option for Pulse/PulseParse code generation
tahina-pro Mar 27, 2026
e0a541b
QuackyDucky -pulse: add enum validator/jumper generation
tahina-pro Mar 27, 2026
e84e5db
PulseParse: add read_enum_key and read_maybe_enum_key
tahina-pro Mar 27, 2026
d177275
QuackyDucky -pulse: add struct (nondep_then) validator/jumper generation
tahina-pro Mar 27, 2026
6fd01b3
QuackyDucky -pulse: add vlbytes validator/jumper generation
tahina-pro Mar 27, 2026
15248d9
fix Makefiles. comment everything but T1 for now
tahina-pro Mar 27, 2026
48e5deb
QuackyDucky -pulse: fix T1 verification and extraction
tahina-pro Mar 27, 2026
9376cbe
QuackyDucky -pulse: add vldata_strong validator/jumper/accessor gener…
tahina-pro Mar 27, 2026
f50e3d4
QuackyDucky -pulse: add vlarray validator/jumper generation
tahina-pro Mar 27, 2026
3e3632e
QuackyDucky -pulse: add fldata_strong, context improvements
tahina-pro Mar 27, 2026
040b4f3
QuackyDucky -pulse: fix T8 with dynamic fuel for large struct synth_i…
tahina-pro Mar 27, 2026
de04c6a
QuackyDucky -pulse: add validate_sum/dsum codegen for select types
tahina-pro Mar 27, 2026
81e213b
QuackyDucky -pulse: optimize T8 verification with targeted ifuel
tahina-pro Mar 27, 2026
77c513e
QuackyDucky -pulse: T7 (dsum with open enum) works
tahina-pro Mar 27, 2026
8122c2c
QuackyDucky -pulse: add bounded_vldata + deplen codegen, fix Empty/Fail
tahina-pro Mar 28, 2026
677eb2a
QuackyDucky -pulse: add bounded_vldata accessor, fix Empty/Fail, test…
tahina-pro Mar 28, 2026
5884422
QuackyDucky -pulse: T18-T21, T39-T41 all work
tahina-pro Mar 28, 2026
96f1e15
QuackyDucky -pulse: T16, T28, T38 work with existing codegen
tahina-pro Mar 28, 2026
a043d7f
QuackyDucky -pulse: T23 works, fix vldata_strong accessor for compile…
tahina-pro Mar 28, 2026
2edb69a
QuackyDucky -pulse: add vlgen, LE, bitcoin_varint, uint24 support
tahina-pro Mar 28, 2026
3560a10
QuackyDucky -pulse: add vclist + leaf_read_bounded_bcvli, all types pass
tahina-pro Mar 28, 2026
261d190
restore tests from Low* (except T0, T27)
tahina-pro Mar 28, 2026
bc9dfea
QuackyDucky -pulse: add implicit sum/dsum codegen + leaf_read_bounded…
tahina-pro Mar 28, 2026
5a04fee
Use validate_dsum_cases_fn with maybe_enum_destr tactic
tahina-pro Mar 29, 2026
af3a287
Fix implicit dsum extraction for Pulse (-pulse) codegen
tahina-pro Mar 30, 2026
d68af3f
QD -pulse: add leaf_reader generation for enums and structs
tahina-pro Mar 30, 2026
564c0b4
PulseParse.Sum: add read_sum_cases infrastructure
tahina-pro Mar 30, 2026
8c92d6a
PulseParse.Sum: implement read_sum leaf_reader combinator
tahina-pro Mar 30, 2026
5669ff9
PulseParse.Sum: implement read_dsum, make f Ghost.erased in dsum acce…
tahina-pro Mar 30, 2026
dafcdce
QD -pulse: add sum/dsum leaf_reader generation, read_false combinator
tahina-pro Mar 30, 2026
eed75c1
fix read_sum extraction
tahina-pro Mar 30, 2026
c98acf0
QD -pulse: add struct field accessors
tahina-pro Mar 30, 2026
45cfc24
QD -pulse: add VLGen payload accessors
tahina-pro Mar 30, 2026
be93571
QD -pulse: add sum/dsum tag and payload accessors
tahina-pro Mar 30, 2026
b1244ee
remove useless files
tahina-pro Mar 30, 2026
40d1687
Makefile: enable QD Pulse tests
tahina-pro Mar 30, 2026
097ea5a
Makefile: enable new LowParse Pulse tests
tahina-pro Mar 30, 2026
1c0435b
LowParse.Pulse.Combinators: add l2r_leaf_write_nondep_then
tahina-pro Mar 31, 2026
8436a57
Pulse l2r_leaf_writer combinators for sum/dsum/struct and QD codegen
tahina-pro Mar 31, 2026
300aa05
Merge branch 'master' into _taramana_pulse_parse
tahina-pro Mar 31, 2026
372fc88
fix some inline_for_extraction
tahina-pro Mar 31, 2026
776e1f6
move enum/sum writers from Combinators to Sum.Aux; eta-expand ifthenelse
tahina-pro Apr 1, 2026
bd988d2
eta-expand l2r_leaf_write_dsum_cases
tahina-pro Apr 1, 2026
efe5194
replace false_elim with dummy
tahina-pro Apr 1, 2026
5752eba
restore bitcoin tests
tahina-pro Apr 1, 2026
6b954e4
Ghost.erase parser_kind args in PulseParse combinators for extraction
tahina-pro Apr 1, 2026
d37fefd
error on warning 272
tahina-pro Apr 1, 2026
e807be3
lift accessor postcond
tahina-pro Apr 2, 2026
63d4752
leaf_read_bounded_integer
tahina-pro Apr 2, 2026
6de4df8
make clens erasable
tahina-pro Apr 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,29 @@ lowparse-bitfields-test: lowparse
+$(MAKE) -C tests/bitfields

ifeq (,$(NO_PULSE))
lowparse-pulse-test:
else
lowparse-pulse-test: lowparse
+$(MAKE) -C tests/pulse
+$(MAKE) -C share/everparse/tests/lowparse
# +$(MAKE) -C tests/pulse # TODO: move it into `share/everparse/tests/lowparse` and re-enable it
else
lowparse-pulse-test:
endif

.PHONY: lowparse-pulse-test

lowparse-test: lowparse-unit-test lowparse-bitfields-test lowparse-pulse-test

quackyducky-test: quackyducky
quackyducky-lowstar-test: quackyducky
+$(MAKE) -C tests

.PHONY: quackyducky-lowstar-test

quackyducky-pulse-test: quackyducky
+$(MAKE) -C share/everparse/tests/qd

.PHONY: quackyducky-pulse-test

quackyducky-test: quackyducky-lowstar-test quackyducky-pulse-test

test: all lowparse-test quackyducky-test asn1-test cbor-test cddl-test

# Disable 3d-unit-test on MacOS because there is a loop in Makefiles
Expand Down
14 changes: 14 additions & 0 deletions share/everparse/tests/lowparse/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Example3/
ExampleConstInt32le/
Example2/
Example5/
ExampleEnum/
Example7/
Example8/
Example9/
Example10/
Example11/
Example12/
ExampleDepLen/
_output/
*.checked
73 changes: 73 additions & 0 deletions share/everparse/tests/lowparse/LowParseExample10.Aux.fst
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
module LowParseExample10.Aux

include LowParse.Spec.Combinators
include LowParse.Spec.Int
include LowParse.Spec.IfThenElse

module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32

(* Use ((U8.t & U8.t) & U8.t) instead of flbytes 3 *)

inline_for_extraction
let msg_type = (U8.t & U8.t) & U8.t

inline_for_extraction
let msg_type_HelloRetryRequest : msg_type = ((0xABuy, 0xCDuy), 0xEFuy)

inline_for_extraction
let msg_type_eq (x y: msg_type) : Tot bool =
let ((a1, b1), c1) = x in
let ((a2, b2), c2) = y in
a1 = a2 && b1 = b2 && c1 = c2

type msg_type_other = (m: msg_type { msg_type_eq m msg_type_HelloRetryRequest == false })

noeq
type t_other = {
msg_type: msg_type_other;
contents: U16.t;
}

noeq
type t =
| HelloRetryRequest of U32.t
| Other of t_other

inline_for_extraction
let t_tag_cond (x: msg_type) : Tot bool =
msg_type_eq x msg_type_HelloRetryRequest

inline_for_extraction
let t_payload (b: bool) : Tot Type =
if b then U32.t else U16.t

inline_for_extraction
let parse_t_payload (b: bool) : Tot (k: parser_kind & parser k (t_payload b)) =
if b then (| _ , parse_u32 |) else (| _, parse_u16 |)

inline_for_extraction
let t_synth (x: msg_type) (y: t_payload (t_tag_cond x)) : Tot t =
if t_tag_cond x
then HelloRetryRequest y
else Other ({ msg_type = x; contents = y })

let parse_msg_type : parser _ msg_type =
parse_u8 `nondep_then` parse_u8 `nondep_then` parse_u8

inline_for_extraction
noextract
let parse_t_param : parse_ifthenelse_param = {
parse_ifthenelse_tag_kind = _;
parse_ifthenelse_tag_t = _;
parse_ifthenelse_tag_parser = parse_msg_type;
parse_ifthenelse_tag_cond = t_tag_cond;
parse_ifthenelse_payload_t = t_payload;
parse_ifthenelse_payload_parser = parse_t_payload;
parse_ifthenelse_t = _;
parse_ifthenelse_synth = t_synth;
parse_ifthenelse_synth_injective = (fun t1 x1 t2 x2 -> ());
}

let parse_t : parser _ t = parse_ifthenelse parse_t_param
231 changes: 231 additions & 0 deletions share/everparse/tests/lowparse/LowParseExample10.fst
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
module LowParseExample10
#lang-pulse
include LowParseExample10.Aux
open FStar.Tactics.V2
open Pulse.Lib.Pervasives
open Pulse.Lib.Slice
open LowParse.Spec.Base

module SZ = FStar.SizeT
module R = Pulse.Lib.Reference
module S = Pulse.Lib.Slice
module LPS = LowParse.Pulse.Base
module LPI = LowParse.Pulse.Int
module LPC = LowParse.Pulse.Combinators
module PPB = LowParse.PulseParse.Base
module PPC = LowParse.PulseParse.Combinators
module PPITE = LowParse.PulseParse.IfThenElse
module Trade = Pulse.Lib.Trade.Util
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module I32 = FStar.Int32
module Cast = FStar.Int.Cast
module A = Pulse.Lib.Array

(* leaf_reader for parse_u8 *)

inline_for_extraction noextract
let leaf_read_u8 : PPB.leaf_reader parse_u8 =
PPB.leaf_reader_of_serialized (LPI.read_u8' ())

(* leaf_reader for msg_type = parse_u8 `nondep_then` parse_u8 `nondep_then` parse_u8
Read the three bytes sequentially using peek_trade_gen *)

inline_for_extraction noextract
let leaf_read_msg_type : PPB.leaf_reader parse_msg_type =
PPC.leaf_read_nondep_then
(PPC.leaf_read_nondep_then leaf_read_u8 LPI.jump_u8 leaf_read_u8 ())
(LPC.jump_nondep_then LPI.jump_u8 LPI.jump_u8)
leaf_read_u8
()

(* Pulse validator *)

inline_for_extraction
let validate_t : LPS.validator parse_t =
PPITE.validate_ifthenelse parse_t_param
(PPC.validate_nondep_then (PPC.validate_nondep_then LPI.validate_u8 LPI.validate_u8) LPI.validate_u8)
leaf_read_msg_type
(fun b -> if b then LPI.validate_u32 else LPI.validate_u16)
()

(* Pulse jumper *)

inline_for_extraction
let jump_msg_type : LPS.jumper parse_msg_type =
LPC.jump_nondep_then (LPC.jump_nondep_then LPI.jump_u8 LPI.jump_u8) LPI.jump_u8

inline_for_extraction
let jump_t : LPS.jumper parse_t =
PPITE.jump_ifthenelse parse_t_param
jump_msg_type
leaf_read_msg_type
(fun b -> if b then LPI.jump_u32 else LPI.jump_u16)
()

(* leaf_readers for payload types *)

inline_for_extraction noextract
let leaf_read_u16 : PPB.leaf_reader parse_u16 =
PPB.leaf_reader_of_serialized (LPI.read_u16' ())

inline_for_extraction noextract
let leaf_read_u32 : PPB.leaf_reader parse_u32 =
PPB.leaf_reader_of_serialized (LPI.read_u32' ())

(* Accessor: read the tag and payload from a validated ifthenelse.
After validation, use peek_trade_gen to get a sub-slice, read
the tag to determine which branch, then jump + read payload. *)

#push-options "--z3rlimit 32"

fn access_payload
(input: S.slice byte)
(#pm: perm)
(#v: Ghost.erased bytes)
(offset: SZ.t)
(off: SZ.t)
(_: squash (LPS.validator_success parse_t offset v off))
requires pts_to input #pm v
returns res: t
ensures pts_to input #pm v
{
let sinput = Ghost.hide (Seq.slice v (SZ.v offset) (Seq.length v));
parse_ifthenelse_eq parse_t_param sinput;
nondep_then_eq (nondep_then parse_u8 parse_u8) parse_u8 sinput;
nondep_then_eq parse_u8 parse_u8 sinput;
parser_kind_prop_equiv parse_u8_kind parse_u8;
let tag_off = SZ.add offset 3sz;
let tag_val = PPB.read_parsed_from_validator_success leaf_read_msg_type input offset tag_off;
let b = t_tag_cond tag_val;
Seq.lemma_eq_elim
(Seq.slice sinput 3 (Seq.length sinput))
(Seq.slice v (SZ.v tag_off) (Seq.length v));
if b {
let payload = PPB.read_parsed_from_validator_success leaf_read_u32 input tag_off off;
HelloRetryRequest payload
} else {
let payload = PPB.read_parsed_from_validator_success leaf_read_u16 input tag_off off;
Other ({ msg_type = tag_val; contents = payload })
}
}

#pop-options

(* synth_recip for parse_t_param (no serializer needed) *)

let synth_recip_t : PPITE.ifthenelse_synth_recip_t parse_t_param =
fun (x: t) ->
match x with
| HelloRetryRequest y -> (| msg_type_HelloRetryRequest, y |)
| Other m -> (| m.msg_type, m.contents |)

let synth_inverse_t (x: t) : Lemma
(let (| tg, y |) = synth_recip_t x in t_synth tg y == x)
= ()

(* clens definitions for the accessor type *)

include LowParse.CLens

let clens_HelloRetryRequest : clens t U32.t = {
clens_cond = (fun x -> HelloRetryRequest? x);
clens_get = (fun (x: t) -> (match x with HelloRetryRequest y -> y) <: Ghost U32.t (requires (HelloRetryRequest? x)) (ensures (fun _ -> True)));
}

let clens_other : clens t U16.t = {
clens_cond = (fun x -> Other? x);
clens_get = (fun (x: t) -> (match x with Other m -> m.contents) <: Ghost U16.t (requires (Other? x)) (ensures (fun _ -> True)));
}

(* Accessors using accessor_ifthenelse_payload combinator + accessor_ext *)

inline_for_extraction
let access_HelloRetryRequest : PPB.accessor parse_t parse_u32 clens_HelloRetryRequest =
PPC.accessor_ext
(PPITE.accessor_ifthenelse_payload parse_t_param synth_recip_t synth_inverse_t jump_msg_type true ())
clens_HelloRetryRequest ()

inline_for_extraction
let access_other : PPB.accessor parse_t parse_u16 clens_other =
PPC.accessor_ext
(PPITE.accessor_ifthenelse_payload parse_t_param synth_recip_t synth_inverse_t jump_msg_type false ())
clens_other ()

(* Test function: validate, determine branch, and use the appropriate accessor *)

#push-options "--z3rlimit 64"

fn dummy
(input: S.slice byte)
(which: U32.t)
(#pm: perm)
(#v: Ghost.erased bytes)
requires S.pts_to input #pm v
returns res: U32.t
ensures S.pts_to input #pm v
{
let mut poffset = 0sz;
let is_valid = validate_t input poffset;
if is_valid {
let off = !poffset;
let sinput = Ghost.hide (Seq.slice v (SZ.v 0sz) (Seq.length v));
parse_ifthenelse_eq parse_t_param sinput;
nondep_then_eq (nondep_then parse_u8 parse_u8) parse_u8 sinput;
nondep_then_eq parse_u8 parse_u8 sinput;
parser_kind_prop_equiv parse_u8_kind parse_u8;
let tag_val = PPB.read_parsed_from_validator_success leaf_read_msg_type input 0sz 3sz;
let b = t_tag_cond tag_val;
let input' = PPB.peek_trade_gen parse_t input 0sz off;
with v1 . assert (PPB.pts_to_parsed parse_t input' #(pm /. 2.0R) v1);
if b {
let sub = access_HelloRetryRequest input';
with v2 pm2 . assert (PPB.pts_to_parsed parse_u32 sub #pm2 v2);
let x = leaf_read_u32 sub;
Trade.elim (PPB.pts_to_parsed parse_u32 sub #pm2 v2) (PPB.pts_to_parsed parse_t input' #(pm /. 2.0R) v1);
Trade.elim (PPB.pts_to_parsed parse_t input' #(pm /. 2.0R) v1) (S.pts_to input #pm v);
x
} else {
let sub = access_other input';
with v2 pm2 . assert (PPB.pts_to_parsed parse_u16 sub #pm2 v2);
let x = leaf_read_u16 sub;
Trade.elim (PPB.pts_to_parsed parse_u16 sub #pm2 v2) (PPB.pts_to_parsed parse_t input' #(pm /. 2.0R) v1);
Trade.elim (PPB.pts_to_parsed parse_t input' #(pm /. 2.0R) v1) (S.pts_to input #pm v);
Cast.uint16_to_uint32 x
}
} else {
0ul
}
}

#pop-options


fn test ()
requires emp
ensures emp
{
let mut arr = [| 0uy ; 8sz |];
let input = S.from_array arr 8sz;
input.(0sz) <- 0xABuy;
input.(1sz) <- 0xCDuy;
input.(2sz) <- 0xEFuy;
input.(3sz) <- 0x55uy;
input.(4sz) <- 0xAAuy;
input.(5sz) <- 0x34uy;
input.(6sz) <- 0x45uy;
input.(7sz) <- 0x00uy;
let res = dummy input 42ul;
S.to_array input;
()
}

fn main ()
requires emp
returns r: I32.t
ensures emp
{
test ();
0l
}
Loading
Loading