RE: [sv-bc] 'inside' on real operands

From: Jonathan Bromley <jonathan.bromley_at_.....>
Date: Mon Sep 10 2007 - 07:03:50 PDT
> A "user beware" note in the LRM might be appropriate, but I agree
> that users should be able to use inside for reals if they want.

Whilst this makes sense from a language design point of view,
I think it's very dangerous.  The obvious intuitive interpretation
of "inside" for reals is "somewhere within this real range". 
When combined with the fact that wildcard comparison makes no
sense for reals, and the fragility of == on reals, I think the
balance should be in favour of prohibiting reals as operands
of 'inside' if the right-hand operand is considered to be 
a countable set of values.  Furthermore, if we preserve the
present meaning of 'inside' whereby its RHS specifies a set
of values, then a real range such as [1.0:2.0] makes no sense.

I completely agree with Steven Sharp that the following
would be both reasonable and (very) useful...

  R inside {[1.0:2.0], [3.0:4.5]}

and I think that's what users would expect to be able to
do - but that makes a specification of a set with an 
uncountable number of members; and it suggests that 
putting anything *except* such ranges on the RHS of 
an 'inside' with real LHS would need to be specified to
be erroneous.
-- 
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK
Tel: +44 (0)1425 471223                   Email: jonathan.bromley@doulos.com
Fax: +44 (0)1425 471573                           Web: http://www.doulos.com

The contents of this message may contain personal views which 
are not the views of Doulos Ltd., unless specifically stated.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Sep 10 07:04:11 2007

This archive was generated by hypermail 2.1.8 : Mon Sep 10 2007 - 07:04:19 PDT