1 research outputs found

    Logical correctness of vector calculation programs

    Get PDF
    Summary. In C-program, vectors of n-dimension are sometimes represented by arrays, where the dimension n is saved in the 0-th element of each array. If we write the program in non-overwriting type, we can give Logical-Model to each program. Here, we give a program calculating inner product of 2 vectors, as an example of such a type, and its Logical-Model. If the Logical-Model is well defined, and theorems tying the model with previous definitions are given, we can say that the program is logically correct. In case the program is given as implicit function form (i.e., the result of calculation is given by a variable of one of arguments of a function), its Logical-Model is given by a definition of a new predicate form. Logical correctness of such a program is shown by theorems following the definition. As examples of such programs, we presented vector calculation of add, sub, minus and scalar product. and [7] provide the terminology and notation for this paper. In this paper m, n, i are natural numbers and D is a set. The following proposition is true (1) For all n, m holds n ∈ m iff n < m. Let D be a non empty set. One can check that there exists a finite 0-sequence of D which is non empty. The following proposition is true (2) For every non empty set D and for every non empty finite 0-sequence f of D holds len f > 0. Let D be a set and let q be a finite sequence of elements of D. The functor FS2XFS(q) yields a finite 0-sequence of D and is defined by: 37
    corecore