Skip to content

Add Data Representation Flattening Pass - #555

Draft
NeilKleistGao wants to merge 9 commits into
hkust-taco:hkmc2from
NeilKleistGao:web🦚

Hidden character warning

The head ref may contain hidden characters: "web\ud83e\udd9a"
Draft

Add Data Representation Flattening Pass#555
NeilKleistGao wants to merge 9 commits into
hkust-taco:hkmc2from
NeilKleistGao:web🦚

Conversation

@NeilKleistGao

Copy link
Copy Markdown
Member
  • Reuse web computation
  • Flatten data representation in a given web

Problems to be addressed:

  • How to track linearity (discussed in the meeting and decided to insert tags for class instances for pattern matching for now).

  • Block IR uses a flattened pattern matching, which makes tag checks difficult. e.g.,

if ls is
    Cons(1, Cons(2, Cons(3, Cons(x, Cons(y, Cons(z, Nil)))))) then x + y + z

It is flattened into:

if ls is
  Cons then
    let x = ls.x
    let xs = ls.xs
    if x == 1 and xs is Cons then ...

Assume that Cons(1, Cons(2, Cons(3, Cons(dyn, Cons(dyn, Cons(dyn, Nil))))))'s tag is 0, we need to check if we want to replace the whole huge matching with the tag checking. It is not clear when to set the boundary to say that the inner irrelevant matchings are untouched. e.g.,

let tmp1 = ...
let tmp2 = ...
let tmp3 = ...
if tmp1 is ....

how should we know whether we are now checking against a nested pattern (e.g., C(D(...), E(...), F(...))), or this is just a user code?

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.

1 participant