Boost logo

Boost :

From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2008-03-25 20:12:46


Larry,

Let me first state that I have to admit to have a very hard time to follow
your discussion with Eric. Before this review I actually thought to
understand Proto (and I've been using it for quite some time during the
Spirit development)....

> On 03/24/08 15:16, Eric Niebler wrote:
> > Larry Evans wrote:
> >> sort of succinct formula. My last attempt was:
> >>
> >>
> http://archives.free.net.ph/message/20080324.160640.f8aed314.en.html
> >
> >
> > I confess I don't understand your notation in that message.
>
> The notation is supposed to be a language grammar similar to that
> shown in compiler texts, except it doesn't surround the grammar
> terminals with quotes. So, to make it closer to that, use:
>
> expr_type
> = 'terminal::type' //rule0
> | (expr_type+)'::type' //rule1
> ;
>
> and where the postfix + means 1 or more of the preceding. So, one
> possible instance of sentence satisfying this grammar is (tracing the
> derivations and subscripting different instances of grammar symbols
> with
> _i, where i is an positive integer, and showing the derivations steps
> with -(ruleX->, where ruleX is one of the comments labelling
> the grammar altenatives in the above equattion):
>
> expr_type
>
> -rule1-> (expr_type_1, expr_type_2, expr_type_3)'::type'
> -rule0-> ('terminal::type'_1 'terminal::type'_2
> 'terminal::type'_3)'::type'
>
> Now, the terminal symbol, 'terminal::type' is supposed to represent
> any proto::terminal<> grammar and the appending '::type' is supposed
> to represent the conversion of the proto::grammar to the corresponding
> expression. The (expr_type+) is supposed to represent any other
> proto "expression" grammar. The reason expr<Tag,expr_type+,Size> was
> not used was because that's just the concrete syntax version of
> expr_type+; hence, just detail. A concrete instance of this would be:
>
> shift_right<terminal<int>::type,terminal<char>::type>::type
>
> where the concrete symbols corresponding to the last step in the
> example
> abstract derivation above are:
>
> 'terminal::type'_1
> == terminal<int>::type
> 'terminal:;type'_2
> == terminal<char>::type
> 'terminal::type'_3
> == //none because shift_right is binary
> ('terminal::type'_1 'terminal::type'_2)'::type'
> == shift_right<terminal<int>,terminal<char>::type>::type

Could you please clarify what you're trying to achieve with this notation?
Is this meant as an alternative notation of expressing proto grammars?
Currently I'm not able to put this in a meaningful relation with Proto, but
this might be my ignorance.

> > I also don't
> > understand what you're trying to get at with morphisms, a concept I
> > don't grasp. Do you think you could try again to explain what you're
> > trying to achieve?

I second Eric's question. What is a morphism in this context and how does it
relate to the discussion of Proto. I take it you're using the term
'morphism' in the mathematical sense of being an "abstraction derived from
structure-preserving mappings between two mathematical structures" (taken
from Wikipedia here: http://en.wikipedia.org/wiki/Morphism). What are you
trying to map onto what?

Regards Hartmut


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk