8000 Aiur StackOverflow · Issue #161 · argumentcomputer/ix · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Aiur StackOverflow #161
Closed
Closed
@storojs72

Description

@storojs72

While exploring Aiur (in Lean), I created following program that does bitwise left-shifting:

-- Left-shifting by k is the same as multiplying an unsigned integer by 2^k, e.g.:
  -- x << 1 = x + x                                 // 2x
  -- x << 2 = (x + x) + (x + x)                     // 4x
  -- x << 3 = (x + x) + (x + x) + (x + x) + (x + x) // 8x
  -- ...
  -- x << k = x ⋆ 2^k
  fn shl(a: u64, b: u64) -> u64 {
    if b {
      shl(add(a, a), sub(b, 1u64))
    } else {
      a
    }
  }

Trying to run the aiurTest with it on the following cases gives me following:

⟨`shl, #[0xffffffffffffffff, 1], #[0xfffffffffffffffe] ⟩, Expected '"ok _"' but got '"error constraint error: zerocheck naive witness validation failed: func-shared-constraint-0, vertex index 1"'
⟨`shl, #[0xffffffffffffffff, 2], #[0xfffffffffffffffc] ⟩, StackOverflow
⟨`shl, #[0xffffffffffffffff, 10], #[0xfffffffffffffc00] ⟩, StackOverflow

Metadata

Metadata

Assignees

No one assigned

    Labels

    aiurbugSomething isn't workinglean

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0