Hello,
I have a project about resolution for predicate logic and I have to wite codes in Java, So, firstly, I need to write an AST in Java for the resolution clasues.
Actually, I'm beginner in programming and I don't know how to wite an AST class for set of clauses.
If anyone has an experiecne with AST and logic, may help me?
Thanks in advance.
how to write an abstract syntax tree code in Java for set of clauses
Started by ama41900, Jun 15 2010 07:17 AM
7 replies to this topic
#1
Posted 15 June 2010 - 07:17 AM
|
|
|
#2
Posted 15 June 2010 - 08:28 AM
AST are returned from parsers; do you need to write them by hand, if so you probably need to write the parser by hand to. If you can get a tool to do it for you try javacc or antlr (Antlr is more complex but more advanced I believe.)
#3
Posted 15 June 2010 - 08:52 AM
hi abzero,
I talked to my supervisor about Antlr and he said that it will be more complex if i use it. he suggested me to write AST by hand and also parser, but firstly I have to start with AST and think about parser later
I talked to my supervisor about Antlr and he said that it will be more complex if i use it. he suggested me to write AST by hand and also parser, but firstly I have to start with AST and think about parser later
#4
Posted 16 June 2010 - 01:20 AM
Ok, I would suggest you first build a grammar for your predicate logic. Do you have examples of valid input's which you want to parse/represent? That would be the easist starting point. As at the moment you don't know what your AST should represent.
#5
Posted 16 June 2010 - 11:59 AM
hi,
Thanks very much for your answers. I just want to know how to find an examples of valid input (number of clauses). my supervisor asked me to collect some examples but I don't know from where?? please bear with me because as I said I'm beginner in programming.
thanks again.
Thanks very much for your answers. I just want to know how to find an examples of valid input (number of clauses). my supervisor asked me to collect some examples but I don't know from where?? please bear with me because as I said I'm beginner in programming.
thanks again.
#6
Posted 16 June 2010 - 11:26 PM
Is this the kind of thing you're looking for?
Resolution Example and Exercises
One of the first steps in programming is understanding the problem domain, otherwise you don't know what your problem your trying to solve.
Resolution Example and Exercises
One of the first steps in programming is understanding the problem domain, otherwise you don't know what your problem your trying to solve.
#7
Posted 17 June 2010 - 04:29 AM
thank you for your help.
In my project i'm just working with clauses. So, if I collect differernt examples of clauses, I need to find an approprite grammar for my clauses??from where?
thanks you really helped me so much
In my project i'm just working with clauses. So, if I collect differernt examples of clauses, I need to find an approprite grammar for my clauses??from where?
thanks you really helped me so much
#8
Posted 17 June 2010 - 11:17 PM
Once you have examples of clauses, you then can write a grammar for them. It's a lot easier that you think, but you need the examples first.


Sign In
Create Account

Back to top









