Skip to content

Why is there a need for a Gallina parser if the term encoder is able to create embeddings for using sexp? #26

Answered by yangky11
brando90 asked this question in Q&A
Discussion options

You must be logged in to vote

It is used to parse an S-expression into the AST of a term. Sure, the S-expression is already a tree and you could parse it trivially using a general-purpose parser for S-expressions, such as sexpdata.

However, you will not get Coq-specific type information from the S-expression alone. For example, if the S-expression is (Dash 0), from Coq's implementation we know that it's actually a proof_bullet defined in:

type t =
| Dash of int
| Star of int
| Plus of int

Parsing the S-expression with sexpdata will not get that information. But we coded the information in gallina.py and vernac_types.py.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@yangky11
Comment options

@brando90
Comment options

@yangky11
Comment options

@brando90
Comment options

@yangky11
Comment options

Answer selected by yangky11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants