UNITY is a programming language created in 1988.
#1740on PLDB | 36Years Old |
UNITY is a programming language constructed by K. Mani Chandy and Jayadev Misra for their book Parallel Program Design: A Foundation. It is a theoretical language which focuses on what, instead of where, when or how. Read more on Wikipedia...
Program bubblesort
declare
n: integer,
A: array [0..n-1] of integer
initially
n = 20 #
<|| i : 0 <= i and i < n :: A[i] = rand() % 100 >
assign
<# k : 0 <= k < 2 ::
<|| i : i % 2 = k and 0 <= i < n - 1 ::
A[i], A[i+1] := A[i+1], A[i]
if A[i] > A[i+1] > >
end
Program shortestpath2
declare
n: integer,
D: array [0..n-1, 0..n-1] of integer
initially
n = 10 #
<|| i,j聽: 0 <= i < n and 0 <= j < n聽::
D[i,j] = rand()聽% 10 >
assign
<|| i,j聽: 0 <= i < n and 0 <= j < n聽::
D[i,j]聽:= min(D[i,j], <min k聽: 0 <= k < n聽:: D[i,k] + D[k,j] >) >
end