Hello again,
I meant nonterminal instead of terminal in the discussion below. I
also meant 'production grammar' instead of 'function grammars'.
Additionally, I will investigating if Compiler.evalExpression can be used to
test whether "pieces" of a production grammar can be parsed as an
optimization instead of parsing the result at the end. I apologize for the
multiple posting - these ideas came to me over time.
Craig
On 3/19/07, Craig Ugoretz <[EMAIL PROTECTED]> wrote:
Hello again,
With more reflection, I think that I may be able to get the ideas I
need strictly from the CTM book. Basically, using choice statements in
functions I can generate a production grammar, using subsets of the values
that the terminals can take on. Then, I can use whether those function
grammars parse or not as a binary constraint. Finally, I can add an
additional constraint that the generated programs be concise as possible.
If I can not find any programs, it may be necessary to increase the number
of values in each "terminal set".
Craig
On 3/19/07, Craig Ugoretz <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I must say that I have skimmed the CTM chapters on relational
> programming and constraint programming and I was just beginning to try to
> understand the sample programs. However, I just located on the internet the
> following website:
http://www.ps.uni-sb.de/~niehren/Web/Vorlesungen/Oz-NL-SS01/vorlesung/
> . I am wondering at this point if the material contained within this
> website could help me create what are termed "production grammars", i.e.
> a scheme for creating combinations of terminals based on production rules.
> In the case of what I want to do, I would want combinations of terminals in
> the Oz grammar that compile into Oz programs. I would, in particular, be
> looking for the shortest possible program (or set of programs) that
> exercises all "paths" in the production rules of the Oz grammar in order to
> test an external parser.
>
>
> Sincerely,
> Craig
>
>
> On 3/19/07, Craig Ugoretz <[EMAIL PROTECTED] > wrote:
> >
> > Hello,
> >
> > I have an idea how to generate test data for a parser that I may
> > need to create for a Java based parser generator. This process
> > would involve using what I have learned about relational programming in the
> > CTM book. However, I am running into a problem with the program blocking on
> > the {Solve F} construct in a sample program that I have created. The
> > program should print out the following strings: ab, ac, ba, bc, ca, cb.
> > The code for the program is given below:
> >
> >
> > declare
> > fun {Pick} choice a [] b [] c end end
> >
> > fun {DiffPair}
> > P1 P2
> > in
> > P1 = {Pick}
> > P2 = {Pick}
> > if P1==P2 then fail else P1#P2 end
> > end
> >
> > fun {SolveAll F}
> > L={Solve F}
> > proc {TouchAll L}
> > if L==nil then skip else {TouchAll L.2} end
> > end
> > in
> > {TouchAll L}
> > L
> > end
> >
> > {Browse {SolveAll DiffPair}}
> >
> >
> > Thanks,
> >
> >
> > Craig
> >
>
>
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users