FACTOID # 3: Andorrans live the longest, four years longer than in neighbouring France and Spain.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

FACTS & STATISTICS    Simple view

  1. Select countries to view: (hold down Control key and click to select several)

     

     

    Compare:

     

     

  1. Select fact or statistic: (* = graphable)

     

     

     

  2. (OPTIONAL) Compare to statistic: (both need to be graphable)

     

     

     

  3. View result as:

     

       
(OR) SEARCH ALL encyclopedia, stats & forums:   

Encyclopedia > UNITY (programming language)

The UNITY programming languages was constructed by K. Mani Chandy and Jayadev Misra for their book Parallel Program Design: A Foundation. It is a rather theoretical language, which tries to focus on what, instead of where, when or how. The peculiar thing about the language is that it has no flow control. The statements in the program run in a random order, until none of the statements causes change if run. A correct program converges into a fix-point. The flow control mechanism is used for controlling the flow of data in a network under well-defined conditions, while congestion control is used for controlling the flow of data when congestion has actually occurred . ... The term statement can have several meanings: In programming, a statement is an instruction to execute something that will not return a value. ... // About Bees This article is about completely random and illogical things. ...

Contents


Description

All statements are assignments, and are separated by #. A statement can consist of multiple assignments, on the form a,b,c := x,y,z, or a := x || b := y || c := z. You can also have a quantified statement list, <# x,y : expression :: statement>, where x and y are chosen randomly among the values that satisfy expression. A quantified assignment is similar. In <|| x,y : expression :: statement >, statement is executed simultaneously for all pairs of x and y that satisfy expression. In computer programming, an assignment is the defining of a variable. ...


Examples

Bubble sort

Bubble sort the array by comparing adjacent numbers, and swapping them if they are in the wrong order. Using Θ(n) expected time, Θ(n) processors and Θ(n2) expected work. The reason you only have Θ(n) expected time, is that k is always chosen randomly from {0,1}. This can be fixed by flipping k manually. Bubble sort, also known as exchange sort, is a simple sorting algorithm. ... A graph with 6 vertices (nodes) and 7 edges. ...

 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 

Rank-sort

You can sort in Θ(logn) time with rank-sort. You need Θ(n2) prosessors, and do Θ(n2) work.

 Program ranksort declare n: integer, A,R: array [0..n-1] of integer initially n = 15 # <|| i : 0 <= i < n :: A[i], R[i] = rand() % 100, i > assign <|| i : 0 <= i < n :: R[i] := <+ j : 0 <= j < n and (A[j] < A[i] or (A[j] = A[i] and j < i)) :: 1 > > # <|| i : 0 <= i < n :: A[R[i]] := A[i] > end 

Floyd-Warshall

Using the Floyd-Warshall all pairs shortest path algorithm, we include intermediate nodes iteratively, and get Θ(n) time, using Θ(n2) processors and Θ(n3) work. In computer science, the Floyd-Warshall algorithm (sometimes known as the Roy-Floyd algorithm or Warshalls algorithm) is an algorithm for solving the all-pairs shortest path problem on weighted, directed graphs in cubic time. ... In graph theory, the single-source shortest path problem is the problem of finding a path between two vertices such that the sum of the weights of its constituent edges is minimized. ...

 Program shortestpath declare n,k: integer, D: array [0..n-1, 0..n-1] of integer initially n = 10 # k = 0 # <|| i,j : 0 <= i < n and 0 <= j < n :: D[i,j] = rand() % 100 > assign <|| i,j : 0 <= i < n and 0 <= j < n :: D[i,j] := min(D[i,j], D[i,k] + D[k,j]) > || k := k + 1 if k < n - 1 end 

We can do this even faster. The following programs computes all pairs shortest path in Θ(log2n) time, using Θ(n3) processors and Θ(n3logn) work.

 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 

After round r, D[i,j] contains the length of the shortest path from i to j of length . In the next round, of length , and so on.


References

  • K. Mani Chandy and Jayadev Misra (1988) Parallel Program Design: A Foundation.

  Results from FactBites:
 
List of esoteric programming languages - Wikipedia, the free encyclopedia (468 words)
The following is a list of esoteric programming languages (programming languages designed as a proof of concept, to test the boundaries of computer language definition, or as jokes, and not with the intention of being adopted for real-world programming).
C-P-L [13], a language in which a non-comment is a syntax error (but on the plus side, all styles of comments are supported, and comments may be arbitrarily nested).
FiPL Fish Programming language (half-joke, a parody on programming language paradigms)
Language in India (16578 words)
The pre-coordinate indexing language model derived for Kannada is applicable to all the Indian languages in general and in particular to Dravidian languages.
Language is not a barrier to the growth of knowledge.The information flood is extensive and complex but at the same time the human memory has not grown in size.
From this point onwards, systematic language activities were taken up by both state and central governments, autonomous institutions etc., to make Kannada as a vehicle of modern thought by using it as a language in education, medium of instruction at as many levels as possible, administration and mass communication.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.