RE: [sv-ec] Re: [sv-bc] operators and data type compatibility rules: mantis item 1608

From: Francoise Martinolle <fm_at_.....>
Date: Fri Sep 29 2006 - 08:15:58 PDT
I entered mantis item 1608 to track this issue.
Once we have concensus, I can prepare a proposal.
 
Please read and comment.
 


________________________________

	From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf
Of Francoise Martinolle
	Sent: Thursday, September 28, 2006 10:45 AM
	To: Vreugdenhil, Gordon; Rich, Dave; Steven Sharp
	Cc: sv-bc@eda.org; sv-ec@eda.org
	Subject: RE: [sv-ec] Re: [sv-bc] operators and data type
compatibility rules
	
	
	Gordon, Dave, Steve,
	 
	I want to enter a mantis item for fixing this issue in the LRM.
	 
	So do I hear that the consensus is 
	 
	1) for equality == and inequality != operators we require that:
	  the class datatypes of left operand and right operand either
match  (this is superseeded by the next 2 rules)
	 or that left operand is assignment compatible with right
operand 
	 or that right operand is assignment compatible with left
operand?
	 
	  The rule is that left operand is assignment compatible with
right operand or right operand is assignment compatible with left.
	 
	  This means that we cannot compare class handles which are not
of the same class hierarchy. Is that really what we want?
	 
	 
	2) For the conditional operator, if the condition is X we
require that if the true and false expressions are of class types, 
	    either the left operand must be assignment compatible with
the right operand,
	    or the right operand must be assignment compatible with the
left operand.
	 
	   if the condition is x, and the right operand is assignment
compatible with the left operand, the result is the left operand (base)
	   if the left operand is assignment compatible with the right
operand, the result is the right operand (base),
	   otherwise the result is null (default initialized value for
class data types).
	 
	  what about if both left and right have matching class data
types? which arm do we return? Do we do class handle
	  comparison and if they are the same return the class handle
(result type is the class data type of either arm)
	  and if the class handles are not the same, return null (result
type is irrelevant for null).
	 
	Francoise
	       '
	 
	 
	 
	
	

________________________________

		From: Vreugdenhil, Gordon
[mailto:gordon_vreugdenhil@mentor.com] 
		Sent: Saturday, September 16, 2006 1:12 AM
		To: Rich, Dave; Steven Sharp; Francoise Martinolle
		Cc: sv-bc@eda.org; sv-ec@eda.org; Vreugdenhil, Gordon
		Subject: RE: [sv-ec] Re: [sv-bc] operators and data type
compatibility rules
		
		



		That would be fine with me too.  I think that it is
overly
		restrictive to require matching, but having a guarantee
		of a common base is sufficient in practice and gives a
		reasonable basis for implementation.
		
		Gord.
		
		-----Original Message-----
		From: Rich, Dave
		Sent: Fri 9/15/2006 9:57 PM
		To: Steven Sharp; fm@cadence.com; Vreugdenhil, Gordon
		Cc: sv-bc@server.eda.org; sv-ec@server.eda.org
		Subject: RE: [sv-ec] Re: [sv-bc] operators and data type
compatibility rules
		
		>
		> Another solution would be to require one of the
expressions to have a
		> type that is assignment compatible with the other.
Whichever one can
		> be assigned from the other (i.e. the base class) is
the type of the
		> result.
		>
		>
		[DR>] I think this is the best solution. It is also what
is needed for b==c. The two classes much match, or one has to be on an
upwards path in the class hierarchy.
		
		
		
Received on Fri Sep 29 08:16:15 2006

This archive was generated by hypermail 2.1.8 : Fri Sep 29 2006 - 08:16:20 PDT