Re: First Order Logic (FOL) parsing

Hans Aberg <>
Fri, 10 Dec 2010 20:27:13 +0100

          From comp.compilers

Related articles
First Order Logic (FOL) parsing (2010-12-07)
Re: First Order Logic (FOL) parsing (Hans Aberg) (2010-12-10)
Re: First Order Logic (FOL) parsing (Gene) (2010-12-10)
Re: First Order Logic (FOL) parsing (2015-05-03)
| List of all articles for this month |

From: Hans Aberg <>
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, 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

And Qu-Prolog looked interesting (don't recall implementation language):

Some other links:

> 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.