Difference between revisions of "RvsZ3"

From ZCubes Wiki
Jump to navigation Jump to search
Line 4: Line 4:
 
Z3 operates on named data structures. The simplest such structure is the numeric vector,
 
Z3 operates on named data structures. The simplest such structure is the numeric vector,
 
which is a single entity consisting of an ordered collection of numbers.  
 
which is a single entity consisting of an ordered collection of numbers.  
 +
 
To set up a vector named x, say, consisting of five numbers, namely 10.4, 5.6, 3.1, 6.4 and 21.7, use the R
 
To set up a vector named x, say, consisting of five numbers, namely 10.4, 5.6, 3.1, 6.4 and 21.7, use the R
 
command
 
command
> x <- c(10.4, 5.6, 3.1, 6.4, 21.7)
+
> x <- c(10.4, 5.6, 3.1, 6.4, 21.7)
  
 
Z3 command to set up a vector is:
 
Z3 command to set up a vector is:
[10.4, 5.6, 3.1, 6.4, 21.7]==>x  
+
[10.4, 5.6, 3.1, 6.4, 21.7]==>x  
 
Or
 
Or
x<==[10.4, 5.6, 3.1, 6.4, 21.7];
+
x<==[10.4, 5.6, 3.1, 6.4, 21.7];
  
 
Alternatively we can use  x=[10.4, 5.6, 3.1, 6.4, 21.7]
 
Alternatively we can use  x=[10.4, 5.6, 3.1, 6.4, 21.7]

Revision as of 02:07, 6 July 2021

Comparison of R vs Z3

Simple manipulations; numbers and vectors

Vectors and assignment

Z3 operates on named data structures. The simplest such structure is the numeric vector, which is a single entity consisting of an ordered collection of numbers.

To set up a vector named x, say, consisting of five numbers, namely 10.4, 5.6, 3.1, 6.4 and 21.7, use the R command

> x <- c(10.4, 5.6, 3.1, 6.4, 21.7)

Z3 command to set up a vector is:

[10.4, 5.6, 3.1, 6.4, 21.7]==>x 

Or

x<==[10.4, 5.6, 3.1, 6.4, 21.7];

Alternatively we can use x=[10.4, 5.6, 3.1, 6.4, 21.7]


Please check back in couple of days. We are updating the page.