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 pedagogical documentation #246

Open
gabrielhdt opened this issue Nov 21, 2021 · 5 comments
Open

More pedagogical documentation #246

gabrielhdt opened this issue Nov 21, 2021 · 5 comments

Comments

@gabrielhdt
Copy link
Member

gabrielhdt commented Nov 21, 2021

In the wake of the new documentation provided by #241, it can be further improved by

  • explaining what the load path is,
  • what happens when --stdin is used and a file is given as positional argument
  • document exit status
@fblanqui
Copy link
Member

Some commands are not explained in README:

  • #REQUIRE: is it mandatory?
  • #NAME: is it still accepted?
  • defac
  • defacu: what does that mean to declare a symbol ACU?
  • #GDT

@francoisthire
Copy link
Collaborator

Indeed, contribution are welcome but in short:

  • #REQUIRE is not mandatory but in some cases it is necessary (a rule in a file which depends on another rule, declared in another file to type check for example)
  • '#NAME' should not be accepted anymore
  • defac is for an ac symbol
  • defacu is for an acu symbol
  • #GDT is to print the decision tree of a symmbol

I welcome contributions with pleasure, but I don't have time to tackle all of this seriously for the moment, unfortunately.

@fblanqui
Copy link
Member

But what ACU implies? Does that mean that matching is modulo ACU?

@francoisthire
Copy link
Collaborator

I suspect that if the top symbol of a rule (the symbol rewritten) is declared as ac or acu then we have matching (or filtering?) which is done ac or acu. I am not certain since I do not know that part of the code. Some description can be found here: #203

@GuillaumeGen
Copy link
Contributor

GuillaumeGen commented Nov 30, 2021

But what ACU implies? Does that mean that matching is modulo ACU?

More or less. I don't know what the exact definition of matching modulo ACU is, but the results of a small experiment tells us that one can match on the presence of the symbol, but not on the length of the list of its arguments (once flatenned), since matching modulo ACU allows to "invent" new application of the neutral element.

N : Type.

0 : N.
s : N -> N.

defacu plus [N, 0].

def f : N -> N.
[] f (plus _ _) --> 0.

#EVAL (f (s (s 0))).  (; This line prints `f (s (s 0))` ;)

def g : N -> N.
[] g (plus _ (plus _ _)) --> 0.

#EVAL (g (plus (s (s 0)) (s 0))). (; This line prints 0` ;)

If one wants to see the "invented 0", modifying the last lines of the example gives us:

def g : N -> N.
h : N -> N -> N -> N.
[x,y,z] g (plus x (plus y z)) --> h x y z.

#EVAL (g (plus (s (s 0)) (s 0))). (; This line prints `h (s (s 0)) (s 0) 0` ;)

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

4 participants