[SAL-HELP] Syntax for defining (and initializing) an array of constants.

Leonardo de Moura demoura at csl.sri.com
Mon Jul 31 09:19:01 PDT 2006


Hi Richard,

You should use an array literal. For example, if you
want the array   [0]=1, [1]=3, [2]=-1, and [3] = 4 then you should
write

[ [ i: [0..3] ]
   IF         i = 0 THEN 1
   ELSIF i = 1 THEN 3
   ELSIF i = 2 THEN -1
   ELSE                      4
]

Another example, if you want a constant array with domain [0..10] and
the value 0 in every index.

[ [ i : [0..10] ] 0 ]

Cheers,
Leonardo


On Jul 31, 2006, at 7:46 AM, <rmbradfo at rockwellcollins.com>  
<rmbradfo at rockwellcollins.com> wrote:

>
> I'm wanting to find out the syntax for defining (and initializing)  
> an array of constants.  Is there a one-step define/initialization  
> statement one can use?  I have not figured it out from the  
> documentation.
>
> Thanks,
> --Richard Bradford

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.csl.sri.com/pipermail/sal-help/attachments/20060731/30041781/attachment.html


More information about the SAL-HELP mailing list