some points about the new 'set' type

From: Yuri Tsoglin <yurit@cadence.com>
Date: Sun Aug 31 2014 - 07:04:08 PDT
Hi all,

This is with regard to Mantis issue 4124 (adding the new 'set' type).

The following pseudo-methods:



set.size(): uint(bits:*)   - returns the number of elements in the set

set.min(): uint(bits:*)   - returns the maximum value in the set

set.max(): uint(bits:*)   - returns the minimum value in the set

seem logically justified, and clearly need to be added to the standard.

Because of performance concerns, caused by the creation of an unbounded integer result, additional pseudo-methods are considered:


set.uint_size(): uint

set.size_is_uint(): bool



set.uint_min(): uint

set.int_min(): int

set.min_is_uint(): bool

set.min_is_int(): bool



(and similar for 'max')

In cases when it is known, or desired to be checked, that the actual size/max/min of a set is small enough to fit in the bounds of int/uint, these methods can be used instead of the above ones, which would avoid a creation of int(bits:*) values.

However, I am in some doubt whether these additional pseudo-methods should be added to the standard as well, and whether these performance concerns (and the fact that unbounded integers have performance overhead vs. 32-bit values) are not considered implementation- (or tool-) specific. From the purely logical and functionality/semantics point of view (disregarding performance), these methods may seem an unneeded overkill.

Please express your opinions on this matter.

Thanks,
Yuri.




[cid:image002.jpg@01CFC53A.901F5020]

Yuri Tsoglin | e Language team, Specman RnD

P: 972.3.9004305 M: 972.54.6468177 F: 972.3.9004001 www.cadence.com<http://www.cadence.com>







-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



image001.gif
image002.jpg
Received on Sun Aug 31 07:04:48 2014

This archive was generated by hypermail 2.1.8 : Sun Aug 31 2014 - 07:04:53 PDT