Kindelia icon indicating copy to clipboard operation
Kindelia copied to clipboard

Parser lhs

Open racs4 opened this issue 2 years ago • 2 comments

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

racs4 avatar Aug 30 '22 02:08 racs4

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 avatar Aug 30 '22 17:08 steinerkelvin

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.

steinerkelvin avatar Aug 30 '22 18:08 steinerkelvin