Subject: Re: about Forall

From: Zheng Gengbin <[email-masked]>
Date: Thu, 26 Sep 1996 09:27:20 +0800 (EAT)

On Tue, 24 Sep 1996, Guansong Zhang wrote:

> Hi,
> 
> Can we design the new derived class in the C++ form? And once finished we can
> put them in .h file! C++ suppose to support this kind of work.
> 
> We can describe each member function a little and then implement them one by
> one later on. I will use my work as an example:
> 
> class SgArrayTripletExp : public SgExpression {
> // variant==DDOT;
> 
> public:
>    SgArrayTripletExp(SgExpression * item0, SgExpression * item1, SgExpression
> *item2);
>    int numberOfItems();
>    SgExpression * item(int i);
> };
> 
> The above derived class was used to analyse array section. Yan Mi may found it
> useful. The member function is quite easy, return the number of items in the
> DDOT.
> 
> Say, 2:4:1, will return 3.
> 
> and item(i) will return the i-th item.
> 
> You will find this function in only partialy implemented, as I do not take care
> of things like A(:). It is not difficult to improve it later.
> 
> More over, the one who need operation on this class may require certain
> functions from his (her) point of view. This will make our design more
> practical.
> 
> The following way of describe what we are going to add is a little too simple.
> No one know what kind of benifit we can get from this two new class.
> 
> Another thing, please be careful. The name in Sage will use Exp as a derived
> class of SgExpression, and Stmt as a derived class of SgStatement. Are we going
> to strike to this?
> 

	The method of my desciption is just for a list which we can exchange
to prevent we build duplicated class . That's not for document .

	I failed to notice that the Exp has special meanning . I think we
should stick to that.

Zheng

---

From: Yan Mi <[email-masked]>
Date: Thu, 26 Sep 1996 10:08:54 +0800 (EAT)

On Tue, 24 Sep 1996, Guansong Zhang wrote:

>    SgArrayTripletExp(SgExpression * item0, SgExpression * item1, 
SgExpression > *item2);
> useful. The member function is quite easy, return the number of items in the
	I have used SgSubscriptExp,and zheng modified it to accord with 
out AST. And I write some code to look up the lbound ,ubound ,step of 
array_section and assumed_array.
 	And I now need SgArrayType::SgArrayType(Sgtype &basetype,SgExpression 
&lbound,sgexpreesion &ubound) to introduce temprary array variable. I 
also write some code to implement in my trnasformation,but because It is 
not a better idea to modify low_level node in my program. so now I asked 
zheng to finish it.
Say, 2:4:1, will return 3. > > and item(i) will return the i-th item.
> Guansong
> On Sep 24, 10:49am, Zheng Gengbin wrote:
> > Subject: Re: about Forall
> > On Mon, 23 Sep 1996, Guansong Zhang wrote:
> >
> > > On Sep 24, 10:07am, Zheng Gengbin wrote:
> > > > Subject: Re: about Forall
> > > > On Mon, 23 Sep 1996, Guansong Zhang wrote:
> > > >
> > > > > On Sep 24,  8:45am, Zheng Gengbin wrote:
> > > > > > Subject: about Forall
> > > > > > Hi,
> > > > > > 	Have you add a new class about forall statement ? then how you
> > > > > > implemented forall statement ?
> > > > > >
> > > > > >
> > > > > > Zheng
> > > > > >-- End of excerpt from Zheng Gengbin
> > > > >
> > > > >
> > > > > Well, I don't add new class for Forall. The reason is that when I first
> > > began
> > > > > the work on this. I know too little about the Sage, while I need to get
> > > > > results, no matter how simple they are, as soon as possible.
> > > > >
> > > > > So I do something of my own.
> > > > >
> > > > > But when I look back now, maybe it is a better idea to define a clear
> > > forall
> > > > > class. But 5,000 lines of code already there. I have no intention to
> change
> > > > > them completely at present time. Maybe in the future. When we have more
> > > time.
> > > > >
> > > > > Laterly, I do begin to build up some class, such as inherit statement,
> and
> > > > > array triplet. It is not difficult. You can see them from the code I
> sent
> > > to
> > > > > you.
> > > > >
> > > > > Next month, as dad version improve, we may support more complicated
> > > alignment
> > > > > and distribution. I may add alignstmt, and distributestmt too.
> > > > >
> > > > > Guansong
> > > > >
> > > >
> > > >
> > > > 	Then I will add Forall class . And please info me the class you already
> > > > added .
> > > >
> > > > 	I will give you a list of our work also .
> > > >
> > > > 	I hope our list is like this:
> > > >
> > >
> > > I don't understand this quite well.
> > >
> > > > 	variant : class ,
> > >
> > > What do you mean by variant? And forall should be derived class for
> > > SgStatement, right?
> > >
> >
> > 	It means that the class is correspond to  the node of that
> > variant .
> > 	In fact in fromsage++.h , you will see the defintion of each derived
> > class as following :
> >
> > class  SgVarRefExp: public SgExpression{
> >   // variant == VAR_REF
> >                 ^^^^^^^
> >
> > each derived class descibe one or more nodes .
> >
> >
> > > >
> > > > 	for example :
> > > >
> > > > 	FORALL_STMT : SgForallStmt
> > > > 	INDEX_OP    : SgIndexOp
> > > >
> > >
> > > INDEX_OP, an derived class of SgExpression?
> > >
> >
> > 	Yes .
> > 	SgIndexOp is the class name, INDEX_OP is the kind of node that the
> class
> > descibes .
> >
> >         What I really concern is that each variant should be correspond to
> > a certain class to descibe them .(although base class can do so in
> > general )
> >
> >
> > Zheng
> >
> >
> >-- End of excerpt from Zheng Gengbin
> 
> 
> On Sep 24,  9:17am, Xiaoming Li wrote:
> > Subject: some case of link b (fwd)
> >
> >
> > ----------
> > Xiaoming Li    (315)443-3890 (o)
> > NPACT          (315)443-1973 (f)
> >
> > ---------- Forwarded message ----------
> > Date: Tue, 24 Sep 1996 08:08:14 +0800 (EAT)
> > From: Yan Mi <[email-masked]>
> > To: Li Xiao_ming <[email-masked]>
> > Cc: zhi_hui Du <[email-masked]>
> > Subject: some case of link b
> >
> > 	Zgs is doing forall statement,and I am using the dir "xsageop" we got
> > from him,But I didn't find the Class SgForallStmt.I only found Class
> SgforStmt
> > (it is for "do statement" in HPF) and it is only one_dimensionl.
> > Regards
> > Yanmi
> >
> >-- End of excerpt from Xiaoming Li
> 
> 
>