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

locally-closed predicate does not type check #10

Open
pa-ba opened this issue Aug 7, 2017 · 0 comments
Open

locally-closed predicate does not type check #10

pa-ba opened this issue Aug 7, 2017 · 0 comments

Comments

@pa-ba
Copy link

pa-ba commented Aug 7, 2017

In the locally-nameless representation the generated locally-closed predicate does not type-check if there is a production that binds a variable for a different non-terminal.

In the example below, the production type_abs binds X, which is a variable for the non-terminal typ:

metavar tvar, X ::=
  {{ repr-locally-nameless }}

grammar

typ, T      :: '' ::=
  | X       ::    :: tvar
  | T -> T' ::    :: tfun

term, t :: '' ::=
  | t [ T ]  ::  :: tapp
  | /\ X . t ::  :: type_abs
   (+ bind X in t +)

In the generated Coq code, the case for the locally-closed predicate for the type_abs production does not type check because it uses open_typ_wrt_typ instead of open_term_wrt_typ:

 | lc_type_abs : forall (L:vars) (t:term),
      ( forall X , X \notin  L  -> lc_term  ( open_typ_wrt_typ t (tvar_f X) )  )  ->
     (lc_term (type_abs t)).
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