[isabelle] Formal BNF grammar (possibly for parser generation, e.g. with antlr 4) for Isar/HOL, for thy files?
- To: "cl-isabelle-users at lists.cam.ac.uk" <cl-isabelle-users at lists.cam.ac.uk>
- Subject: [isabelle] Formal BNF grammar (possibly for parser generation, e.g. with antlr 4) for Isar/HOL, for thy files?
- From: Alex Meyer <alex153 at outlook.lv>
- Date: Thu, 9 Jul 2020 07:42:49 +0000
- Accept-language: lv-LV, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Yw8SRlxmwD4M6C1HsaaFZaFgmR6OKJ4B77ixYaZaljU=; b=kyhgynYbqMmf+akcdG+cW++w2RxIlex8O8vLGNKPkrsMECDxA8TyOOIf+elyj2uxYYcbj+kiWJir6i7edpPl7vqCEjOIldctfQAVsW04luS0xsPZYFquvRKNIjrT9RvXyhkUYLyXfgNx3oVa1UVL99Cqa9ZO03vOwKVGilPuPsJ64CNzESRYCCQqRYOyw89ehz+EfBhVnPx3/9DgJFGSs1MT8+hvmFkI+WtjuKIh9w9ncO/vqlJEhVdP2eazLqban0l6kg4kIU1V1zWSBNUPu4CaF/e9cmNZtLe9ZuCLP7lWnPBon+b7YsZiRJ6drPutgKnXtC1Cvr41CL14hdVm7A==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZuJoaN/1vzVaoPkW3bADojILAdt5qZ97dOP6FOzt1RYw2C1KIQpoMgCIt37/GeJxfJR045VmnsuQpOOn06v9x8uaDwtRSkU+vm0gNhWib2SsA6Dtds7DVF+MeO9Ml2he33nOEBPqAJ20hJuzdSUGE8gnsEHA7qwFWQZGaNvTTrTXpjH4BeY6bS0uRbDz+o4UyaMmccxZ0cIC/KFqM8nRiWIB5SnYISfumxIBrP1CaiYuMh7vdtgU7BCydwPeC4twz60jvctotOFeHUYuQLttkTwtdHIb3NPbs77emPQj7xSCxsuzMcez5jFUyze0xb/K7ulnoBqacKWCkoe9DS/BIw==
- Thread-index: AQHWVcSLCAd/gird5kOpW5U0V98h9Q==
- Thread-topic: Formal BNF grammar (possibly for parser generation, e.g. with antlr 4) for Isar/HOL, for thy files?
I am trying to ignite my framework (in very early, experimental stage, I still don’t know whether I can succeed) for program synthesis/algorithm synthesis and all of that reduces to the generation of the thy files, like one for the insertion sort algorithm https://www.isa-afp.org/browser_info/current/AFP/Imperative_Insertion_Sort/Imperative_Insertion_Sort.html (from https://www.isa-afp.org/entries/Imperative_Insertion_Sort.html). For that to happen I am going to try to read thy files, translate concrete syntax to AST, manipulate, translate from AST to concrete Isabelle syntax and write back thy files. To set up such infrastructure more or less automatically, the BNF files for the HOL/Isar grammar should be available. I am trying to find them, so far I have found:
Fig. 2.2. is HOL grammar (inner grammar)
Fig. 2.2 is Isabelle outer grammar, Isar reference contains lot of grammar rules apart from this picture – I wonder – whether they are available as one file.
Repository https://isabelle-dev.sketis.net/source/isabelle/browse/default/src/HOL/ (and others) contain BNF_... files that may hint to Backus-Naur Form, but I have heard that BNF can be abbreviation for something else too in Isabelle context.
So – maybe there is some set of complete BNF grammar files for thy files, than contain both inner and outer syntax. E.g. there is https://github.com/antlr/grammars-v4/blob/master/fol/fol.g4 grammar which ANTLR 4 uses for generation of Java parser for FOL (classical syntax), and from that parser I can easily build processors that extracts AST from the parsed FOL text. I would like to gather full grammar for thy files and use it with ANTLR to generate Java parser for thy files. And then I can write AST manipulate code in Java.
___Is it achievable task, are there similar efforts and are there complete grammars for thy files?___
I guess that already found grammars (HOL and Isar outers syntax) is sufficient for me to continue my effort, but maybe there are some roadblocks ahead?
I have heard about Czech efforts to set up neural theorem provers and possibly they use some custom thy parsers and thy AST manipulators as well.
[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-green-avg-v1.png]<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Virus-free. www.avg.com<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
This archive was generated by a fusion of
Pipermail (Mailman edition) and