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

No deref on HO variable when unifying? #232

Open
FissoreD opened this issue May 27, 2024 · 5 comments
Open

No deref on HO variable when unifying? #232

FissoreD opened this issue May 27, 2024 · 5 comments

Comments

@FissoreD
Copy link
Collaborator

This code does not work:

type f any -> o.

main :-
  P = x\x,             % p1
  pi x\ f x = A (P x), % p2
  A = f.               % p3

Error msg: Anomaly: Non deterministic pruning, delay to be implemented: t=A1 (≪.X0≫_0 c1), delta=0
I would expect that after p1, p2 becomes pi x\ f x = A x, so that A := (x\ f x) or better A := f

@gares
Copy link
Contributor

gares commented May 27, 2024

Surely a bug

@gares
Copy link
Contributor

gares commented Sep 19, 2024

Not a bug, but a missing feature. It seems move needs to do no restriction, but instead checks if doing it would be deterministic, and it would be not (but is also unnecessary)

@nguermond
Copy link

nguermond commented Jan 29, 2025

I want to submit a further example where this would be useful, and not involving a beta reduction:

type subst any -> any -> o.
subst X TX :- T X = TX.       %% X is not dereferenced

main :- pi x \ subst x (foo x).

with the slightly different Unification problem outside the pattern fragment. error.
At runtime, X is an eigenvariable, so it should fall within the pattern fragment.

The more general use case is the following. Given a ground term TX possibly depending on a known list of eigenvariables [x1, ... , xn], it would be useful to solve TX = T x1 ... xn which is in the pattern fragment.

@gares
Copy link
Contributor

gares commented Jan 29, 2025

This one is not a bug, since T sees X twice (one copy is passed, but T is also generated under the pi...).
This one works as you expected:

type foo any -> any.

type subst (any -> any) -> any -> any -> o.
subst T X TX :- T X = TX.       %% X is not dereferenced

main :- pi x \ subst T x (foo x).

@nguermond
Copy link

This makes sense, thanks for catching that.

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