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

Aladdin Proposals #4

Open
KiJeong-Lim opened this issue Jan 19, 2021 · 1 comment
Open

Aladdin Proposals #4

KiJeong-Lim opened this issue Jan 19, 2021 · 1 comment

Comments

@KiJeong-Lim
Copy link
Owner

KiJeong-Lim commented Jan 19, 2021

  1. Introduce module system.
  2. Introduce Haskell's feature (data rather than kind, type synonym, type class).
  3. Make error messages pretty.
  4. Allow D ::= D /\ D.
  5. Allow user-defined operators.
  6. Introduce constraint handling rules (CHR) like Elpi.
@KiJeong-Lim KiJeong-Lim changed the title Aladdin Proposal Aladdin Proposals Jan 19, 2021
@KiJeong-Lim
Copy link
Owner Author

KiJeong-Lim commented Apr 10, 2021

  1. CHR:
    <Goal> ::= <Var> "with" <Goal>
    G with P successes iff X is a logic variable.
    if X with P successes then yields constraint P for X.

  2. Meta Aladdin:

module TC.

from Std import Aladdin.MetaAladdin as MA.

data ty : * where
  all : (ty -> ty) -> ty.
  arr : ty -> ty -> ty.

data tm : * where
  abs : (tm -> tm) -> tm.
  app : tm -> tm -> tm.
  let : tm -> (tm -> tm) -> tm.

check (let Rhs Body) Tau :-
  MA.runMeta (MA.mkNewVar (Sigma0\ MA.solve (check Rhs Sigma0) (Res Sigma0))),
  -- Res := Sigma0\ sigma (Alpha_1\ ... sigma (Alpha_n\ Sigma = Gen Alpha_1 ... Alpha_n)) for some skeleton Gen 
  generalize (Res _) Scheme,
  -- Scheme := all (Alpha_1\ ... all (Alpha_n\ Gen Alpha_1 ... Alpha_n))
  pi (X\ check X Scheme => check (Body X) Tau).

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