Skip to content

Parser lhs#135

Open
racs4 wants to merge 4 commits into
kindelia:masterfrom
racs4:parser-lhs
Open

Parser lhs#135
racs4 wants to merge 4 commits into
kindelia:masterfrom
racs4:parser-lhs

Conversation

@racs4
Copy link
Copy Markdown
Contributor

@racs4 racs4 commented Aug 30, 2022

This PR:

  • parse lhs in Rule structure as a Vec<Term> (only the args of rules are parsed now)
  • raises error if rule name is different of function name

closes #124

@steinerkelvin
Copy link
Copy Markdown
Contributor

steinerkelvin commented Aug 30, 2022

As this changes the serialization that is part of the prococol (here) — as I'm realizing now — I'm gonna cc @VictorTaelin to check if this is ok.

To clarify the problem:

We should have a type-safe Term::Fun that can only ever stores small names (72-bit names that can be called directly). But the current Funcs are represented as a list of pairs (rules) (Term, Term) and the LHS's would not be able to store big names (as it should be).

So we propose changing the Rule type to be:

  • a list of Term arguments, instead of an intire Term::Func — that would include it's name);
  • plus the Term body;

It's serialization as in here — on would only have to update the Whitebook.

@steinerkelvin
Copy link
Copy Markdown
Contributor

So, actually, funs will name will be limited to 72-bits. Names will universally be limited to 72-bits. There would be no such thing as big names.

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.

Specific parser for rules LHS

2 participants