Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bulky representation of concrete words #22

Open
aa755 opened this issue Sep 20, 2018 · 2 comments
Open

bulky representation of concrete words #22

aa755 opened this issue Sep 20, 2018 · 2 comments

Comments

@aa755
Copy link

aa755 commented Sep 20, 2018

Because of indices (which nest), every concrete 64 bit word has 2080 S constructors, even though it has only 64 WS constructors. Should we opt for a less intrinisically dependently typed variant like Word s := {n:N | log n< s}?

Fixpoint sumFirstN (n : nat) : nat :=
match n with
| O => O
| S n => (S n) + (sumFirstN n)
end.

Eval compute in (sumFirstN 64)
@gmalecha
Copy link
Collaborator

I'm in favor of this. See the discussion in #21

@samuelgruetter
Copy link
Contributor

I already did this for riscv-coq, see here.

I use the following representation:

  Record word_record{sz: Z} := Build_word {
    word_val: Z;
    word_mod: word_val mod 2 ^ sz = word_val
  }.

It seems to work well in the sense that I use it everywhere in riscv-coq and in bedrock2, without any problems.

If you want to use that too, we should incorporate this into bbv, PRs welcome 😉

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

No branches or pull requests

3 participants