[antlr-interest] Factorization of Logic Expressions

Joseph Areeda newsreply at areeda.com
Wed Mar 17 10:26:35 PDT 2010


This might be a bit simplistic, but why not save the original expression
as a string?  Then you could compare that with your processed version.

Joe

Nazim Oztahtaci wrote:
> Hello everyone,
> I would like to thank everyone first of all during their help when I became a new member to this group. I am working on Antlr and my task since last month. I am able to parse a logic expression such as a(b+c) into a tree, then I apply Demorgan and distribution so I reach a DNF representation: ab+ac.. The operators that I support are NOT, OR, AND, >, <. Timer and IF-ELSE statements. 
> Now Im working on factorizing the DNF formed expressions back to originial because the user of my program will be able to read output data file which has only string representation of DNF expression. So I need to factorize the DNF expression. The way I try to do is putting the expression in a matrix such as
>  a b c
>  1 1 X  ab
>  1 X 1  ac
>
> Then reading this matrix to find the most number of 1s and then re-check these rows if there are any more subsequences and so on.. I know that I cant reach the original expression everytime for the complicated expressions. Also for the reverse Demorgan, I cant use this matrix probably. I wanted to ask users of this mail group if they have any advice to me regarding an algorithm for this problem or a new way as solution.
>
> I know it is a bit hard and rare problem so even no help will be available for me, I appreciate for previous helps as well.
>
> Thank you all and good luck everyonje with their studies
> Nazim
>  		 	   		  
> _________________________________________________________________
> Yeni Windows 7: Size en uygun bilgisayarı bulun. Daha fazla bilgi edinin.
> http://windows.microsoft.com/shop
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>   



More information about the antlr-interest mailing list