Re: Meta-Interpreater

Martin Riener <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
Hi,

It's certainly possible to write the grammar and use a metainterpreter
afterwards to get the parse tree. For that two things have to work:

a) the evaluation of the dcg works directly intepreted
b) you run the dcg on a meta-interpreter to extract the tree

it seems, you are still stuck with a), so step b) can not give better
results. In fact, a meta-interpreter has a high performance cost, so
depending on what your prof says, it might be better to replace b with
the step

c) extend your grammar to carry on the parse tree (perhaps have a look
at [1] to find a small tutorial about how to do parsing with dcgs, they
can build parse trees without using a meta-interpreter)

if path c) is viable or not is up to your prof.

hope this clears stuff up a bit,
cheers Martin


[1] http://www.pathwayslms.com/swipltuts/dcg/


On 04/01/2014 03:51 PM, [email protected] wrote:
> Thanks for your response.
> Actually the assignment spect says:- The aim of this assignment is to develop a computer program that inputs a protein sequence, determines weather that sequence can be parsed by a given biological grammer and if so, shows how the sequence can be broken down into gramatical constructs. And aim is also to develop a prolog meta interpreater that not only determines wheather a sentence can be parsed by a grammer but also generate a parse tree.
>  I have made an interpreater which reads the grammer and the sequennce but it continue reading forever. I know this is because I am new to this programing language. So I will be glad if you can be of help.
> thanks
> 
> _____________________________________
> Sent from http://swi-prolog.996271.n3.nabble.com
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.