Skip to content

An example showing how to read from an array of structs#109

Open
nikswamy wants to merge 1 commit into
mainfrom
_array_example
Open

An example showing how to read from an array of structs#109
nikswamy wants to merge 1 commit into
mainfrom
_array_example

Conversation

@nikswamy

Copy link
Copy Markdown
Contributor

Possibly useful reference to have in the test suite

… structs. Possibly useful reference to have in the test suite
Comment on lines +38 to +39
let entry_ok ($(e): $type(entry_t)) : prop =
UInt32.v $(e.x) < 10

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let entry_ok ($(e): $type(entry_t)) : prop =
UInt32.v $(e.x) < 10
_let(bool entry_ok(entry_t e), e.x < 10)

Comment on lines +45 to +47
let entries_ok (s: Seq.seq (option $type(entry_t))) (n: nat) : prop =
forall i. i < n ==> Some? (Seq.index s i) ==>
entry_ok (Some?.v (Seq.index s i))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let entries_ok (s: Seq.seq (option $type(entry_t))) (n: nat) : prop =
forall i. i < n ==> Some? (Seq.index s i) ==>
entry_ok (Some?.v (Seq.index s i))
let entries_ok (s: array_spec $type(entry_t)) (n: nat) : prop =
forall i. i < n ==> array_spec_initd s i ==>
entry_ok (array_spec_idx s i)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants