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

Cannot distill homeomorphic embedding #20

Open
hirrolot opened this issue Dec 1, 2024 · 0 comments
Open

Cannot distill homeomorphic embedding #20

hirrolot opened this issue Dec 1, 2024 · 0 comments

Comments

@hirrolot
Copy link

hirrolot commented Dec 1, 2024

Distillation on the following code does not terminate in a reasonable amount of time (~3 hours):

main = decideHe s t;

decideHe s t = case s of
    Call(h, args) -> (case t of
        Call(h', args') -> (case dive s args' of
            T -> T
          | F -> (case equalSymbols h h' of
                T -> couple args args'
              | F -> F)));

dive s args' = case args' of
    Nil -> F
  | Cons(t, ts) -> (case decideHe s t of
        T -> T
      | F -> dive s ts);

couple args args' = case args of
    Nil -> (case args' of
        Nil -> T
      | Cons(t, ts) -> F)
  | Cons(s, ss) -> (case args' of
        Nil -> F
      | Cons(t, ts) -> case decideHe s t of
            T -> couple ss ts
          | F -> F);

equalSymbols h h' = case h of
    A -> (case h' of
        A -> T
      | B -> F
      | C -> F)
  | B -> (case h' of
        A -> F
      | B -> T
      | C -> F)
  | C -> (case h' of
        A -> F
      | B -> F
      | C -> T)

The higher-order deforester terminates almost immediately on this program (although the result is not very interesting -- the intermediate boolean values were still there).

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