Science Fair Projects Ideas - Occam programming language

All Science Fair Projects

      

Science Fair Project Encyclopedia for Schools!

  Search    Browse    Forum  Coach    Links    Editor    Help    Tell-a-Friend    Encyclopedia    Dictionary     

Science Fair Project Encyclopedia

For information on any area of science that interests you,
enter a keyword (eg. scientific method, molecule, cloud, carbohydrate etc.).
Or else, you can start by choosing any of the categories below.

Occam programming language

Occam (from William of Ockham of Occam's Razor fame) is a parallel programming language that builds on Communicating Sequential Processes (CSP) and shares many of their features. It is, in a way, a practical executable implementation of CSP.

Occam is an imperative procedural language (such as Pascal). Occam was developed by Inmos for their line of Transputers, but implementations for other platforms exist as well.

Overview

Note that in the examples below indentation and formatting are critical for parsing the code: expressions are terminated by the end of the line, lists of expressions need to be on the same level of indentation (this feature is also found in other languages, such as Python, Haskell, Icon, NGL, Miranda, and ABC).

Communication between processes work through named channels. One process outputs data to a channel via ! while another one inputs data with ?. Input and output will block until the other end is ready to accept or offer data. Examples (c is a variable):

 keyboard ? c
 screen ! c


SEQ introduces a list of expressions that are evaluated sequentially. This is not implicit as it is in most other programming languages. Example:

 SEQ
   x := x + 1
   y := x * x

PAR begins a list of expressions that may be evaluated concurrently. Example:

 PAR
   x := x + 1
   y := y * 2

ALT specifies a list of guarded commands. The guards are combination of a boolean condition and an input expression (both optional). Each guard for which the condition is true and the input channel is ready is successful. One of the successful alternatives is selected for execution. Example:

 ALT
   count1 < 100 & c1 ? data
     SEQ
       count1 := count1 + 1
       merged ! data
   count2 < 100 & c2 ? data
     SEQ
       count2 := count2 + 1
       merged ! data
   status ? request
     SEQ
       out ! count1
       out ! count2

This will read data from channels c1 or c2 (whichever is ready) and pass it into a merged channel. If countN reaches 100, reads from the corresponding channel will be disabled. A request on the status channel is answered by outputting the counts to out.

Occam 2

Occam 2 is an extension produced in 1987. Occam 2 adds floating-point, functions and a type system.

["occam 2 Reference Manual", INMOS, P-H 1988, ISBN 0-13-629312-3].


External links

03-10-2013 05:06:04
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details
Science kits, science lessons, science toys, maths toys, hobby kits, science games and books - these are some of many products that can help give your kid an edge in their science fair projects, and develop a tremendous interest in the study of science. When shopping for a science kit or other supplies, make sure that you carefully review the features and quality of the products. Compare prices by going to several online stores. Read product reviews online or refer to magazines.

Start by looking for your science kit review or science toy review. Compare prices but remember, Price $ is not everything. Quality does matter.
Science Fair Coach
What do science fair judges look out for?
ScienceHound
Science Fair Projects for students of all ages
All Science Fair Projects.com Site
All Science Fair Projects Homepage
Search | Browse | Links | From-our-Editor | Books | Help | Contact | Privacy | Disclaimer | Copyright Notice