-
I was able to generate an embedding using sexp and the ASTactic term encoder. Sample code:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
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 CoqGym/coq/proofs/proof_bullet.ml Lines 13 to 16 in 4c205a7 Parsing the S-expression with sexpdata will not get that information. But we coded the information in gallina.py and vernac_types.py. Lines 1968 to 1980 in 4c205a7 So using GallinaTermParser to parse (Dash 0) will produce a node labeled vernacexpr__bullet
|
Beta Was this translation helpful? Give feedback.
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 aproof_bullet
defined in:CoqGym/coq/proofs/proof_bullet.ml
Lines 13 to 16 in 4c205a7
Parsing the S-expression with sexpdata will not get that information. But we coded the information in gallina.py and vernac_types.py.
Coq…