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

more efficient defs #3

Open
c-cube opened this issue Jan 6, 2017 · 0 comments
Open

more efficient defs #3

c-cube opened this issue Jan 6, 2017 · 0 comments
Assignees

Comments

@c-cube
Copy link
Owner

c-cube commented Jan 6, 2017

definition of a constant should be:

type def =
  | Rule of rule
  | Fun of builtin_fun

type defs =
  | Def_cst of expr (* the constnat itself is defined *)
  | Def_n of def list

type cst = {
  cst_defs: defs;
  ...
}

This way, a = … is efficient because it erases previous bindings, etc. instead of accumulating.

Also, pat := foo should erase any previous rule of Head[pat] that is matched by pat (if the LHS is matched, it means the rule is subsumed and will never fire).

@c-cube c-cube self-assigned this Jan 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant