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

True/False #2

Open
Alexey-T opened this issue Feb 26, 2023 · 1 comment
Open

True/False #2

Alexey-T opened this issue Feb 26, 2023 · 1 comment

Comments

@Alexey-T
Copy link

Alexey-T commented Feb 26, 2023

in the lang new examples dir, I found samples with lowercase 'true'/'false'.
but your ST3 syntax file has 'True|False' in sentence case.
bug?

@Alexey-T
Copy link
Author

example

-- Once failed in fusion.  Derived from tail2futhark output.
-- ==
-- input { [1, 2, -4, 1] [[1, 2], [-4, 1]] }
-- output {
--          [[true, false, false, false, false, false, false, false, false, false, false,
--            false, false, false, false, false, false, false, false, false, false, false,
--            false, false, false, false, false, false, false, false],
--           [false, false, false, false, false, false, false, false, false, false, false,
--            false, false, false, false, false, false, false, false, false, false, false,
--            false, false, false, false, false, false, false, false],
--           [true, false, false, false, false, false, false, false, false, false, false,
--            false, false, false, false, false, false, false, false, false, false, false,
--            false, false, false, false, false, false, false, false]]
-- }
-- structure { /Screma 3 /Screma/Screma 1 }
def main(t_v1: []i32) (t_v3: [][]i32): [][]bool =
  let n = 3
  let t_v6 = map (\(x: i32): i32  -> (x + 1)) (map i32.i64 (iota(n)))
  let t_v12 = map (\(x: i32): i32  -> (x + 1)) (map i32.i64 (iota(30)))
  let t_v18 = transpose (replicate 30 t_v6)
  let t_v19 = replicate n t_v12
  let t_v27 = map (\(x: []i32,y: []i32)  ->
                    map2 (^) x y) (
                  zip (t_v18) (
                      map (\(x: []i32)  -> map (<<1) x) (t_v18)))
  let t_v33 = map (\(x: []i32)  ->
                    map (\(t_v32: i32): bool  ->
                          ((0 != t_v32))) x) (
                    map (\(x: []i32,y: []i32)  ->
                          map2 (&) x y) (
                        zip (t_v27) (
                            map (\(x: []i32)  ->
                                  map (\(t_v29: i32): i32  ->
                                        (1 >> t_v29)) x) (
                                  map (\(x: []i32)  ->
                                        map (\(t_v28: i32): i32  ->
                                              (t_v28 - 1)) x) (
                                        t_v19))))) in
  t_v33

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

1 participant