Re: First Order Logic (FOL) parsing

Hans Aberg <haberg-news@telia.com>
Fri, 10 Dec 2010 20:27:13 +0100

          From comp.compilers

Related articles
First Order Logic (FOL) parsing Erotavlas_turbo@libero.it (2010-12-07)
Re: First Order Logic (FOL) parsing haberg-news@telia.com (Hans Aberg) (2010-12-10)
Re: First Order Logic (FOL) parsing gene.ressler@gmail.com (Gene) (2010-12-10)
Re: First Order Logic (FOL) parsing raniascience1@gmail.com (2015-05-03)
| List of all articles for this month |

From: Hans Aberg <haberg-news@telia.com>
Newsgroups: comp.compilers
Date: Fri, 10 Dec 2010 20:27:13 +0100
Organization: A noiseless patient Spider
References: 10-12-016
Keywords: parse
Posted-Date: 14 Dec 2010 20:35:05 EST

On 2010/12/07 09:49, Erotavlas_turbo@libero.it wrote:
> I'm new about the topic of parsing. I have to develop a parser/compiler for
> First Order Logic (FOL) clauses in C/C++ language. I have made a lot of search
> on the web but I have found only a source codes written in ML, PROLOG,
> Haskell, Python, etc.


There is Otter
      http://www.mcs.anl.gov/research/projects/AR/otter/index.html


And Qu-Prolog looked interesting (don't recall implementation language):
      http://www.itee.uq.edu.au/~pjr/HomePages/QuPrologHome.html


Some other links:
      http://www.mcs.anl.gov/research/projects/AR/others.html
      http://en.wikipedia.org/wiki/Automated_theorem_proving


> At the moment I'm studying Flex and Bison to understand how I can generate a
> parser. I think it's a big work for me.


It depends on what you mean by "first order logic". If it involves
quantifiers that bind variables, that is a lot of tricky work to get it
correct. So it is best to settle on some library that can do that for
you, if such one exists.


If you merely want Prolog style free variables, then the Haskell
interpreter Hugs has a mini-Prolog example. I once translated it into C++.


As for getting started with Bison/Flex, try the C++ calculator example
in the Bison manual, which also comes in the distribution. Then it is
easy to rewrite it.



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.