SETL

SETL ( Set Language, English. Lot for language ) is a high level programming language which is based on the set theory of mathematics. It was 1969/70 developed by Jack Schwartz at the Courant Institute of Mathematical Sciences of New York University.

As a fundamental data types knows SETL Integer, Real, String, Boolean, and the zero value Omega ( om ). There is no strong typing, the data type of a variable is adjusted according to the mapped content. Furthermore, SETL has about garbage collection.

SETL provides two data structures, the unordered set ( engl. amount ) and the tuple (English tuples) as an ordered sequence of elements. One set has the peculiarity that in it no value occurs twice in a tuple, this is permitted. Except for this limitation, the contents of a set or a tuple is arbitrary, it can also include more sets and tuples. A special case is the map (short for mapping, Eng. Figure). It is a set of pairs and consists of tuples of length 2

Furthermore SETL provides do- while loops, if-then -else and case statements are available. There are also specialized loops to iterate through the tuples and sets.

From home SETL provides numerous operators for basic arithmetic and trigonometric and other mathematical functions. Furthermore it has SETL special operators for working with quantities and strings. In addition, you can define your own operators.

Implementation

Based on years of collaboration between New York University and scientists from Novosibirsk, SETL has been implemented not only on computers of the American company Burroughs, but also on Russian computers of the type BESM -6 and ES EVM. Meanwhile, there are also various implementations for all major operating systems.

Sample Source

Two examples for outputting all prime numbers from 2 to n, especially at the second example, it can be seen that the language based on set theory.

Program primes;    $ This program prints all the prime numbers that are smaller than the read parameter    read ( s); $ read a parameter    primes: = {}; $ Amount of the issued primes    p: = 2; set $ first prime    $ Loop to determine more primes    loop while p < n do $ Repeat as long as p is less than n      if NotExists t in primes | p mod t = 0 then        print ( p); $ not the determined bisherig primes divisors of p, so give the prime of        primes with: = p; Add $ they add to the amount of the issued primes      end if;      p: = p 1; $ Increase to Test number by one    end loop; end program primes; program primzahlen2;    read ( s);    print ( { p in { 2 } n | forall t in { 2 p - 1} | p mod t> 0. . });    $ Enter the set of all numbers p from the set 2 to n for which valid    $ that p is divisible by any of the numbers in the set 2 to p-1 smooth   end program primzahlen2; Web Links

  • Documentation of the SETL programming language (English )
  • SETL compiler (English )
  • Programming language
725085
de