Language peer sets for SETL: United States↑ United States/1970↑ Designed 1970 ↑ 1970s languages ↑ Third generation↑ High Cold War↑ Genus Set ↑ Specialised Languages ↑ Set↑ Rank 1 unlabelled↑ Rank 1 ↑ Set/1970↑ Rank 1 unlabelled/1970↑ Rank 1/1970↑ Set/United States↑ Rank 1 unlabelled/United States↑ Rank 1/United States↑ Specialised Languages ↑ Specialised Languages/1970↑ Specialised Languages/us ↑
SETL(ID:1268/set002)
Set based programming language
alternate simple view
Country: United States
Designed 1970
Published: 1970
Genus: Set
Sammet category: Specialised Languages SET Language. Courant Inst, early 70's. A very high level set-oriented language. Data types include sets (unordered collections), tuples (ordered collections) and maps (collections of ordered pairs). Expressions may include quantifiers ('for each' and 'exists'). The first Ada translator was written in SETL.
The optimisation routines developed in making the SETL compilers have been quite influential, especially in quantification and automatic type discovery. Places
$ This program prints out a list of prime numbers $ which includes all primes less than 200
n := 200; print('Primes less than ',n,' are:'); primes := {}; $ set of primes output so far p := 2; $ initial value to test c := 0;
$ Loop to test successive values
loop while p < n do $ loop as long as p less than n if notexists t in primes | p mod t = 0 then print(p); primes with:= p; c := c + 1; end if; p := p + 1; end loop; print('Number of primes < 200 = ', c); end program;
program main; proc fact; n:=4; num:=fact(n); print(n,' factorial is: ',num);
proc fact(n); if n=1 then return 1; else return n*fact(n-1); end if; end proc; end prog;
$Sample program - Chapter 11.1 program euler; $ Eulerian path construction proc euler_path,build_path; $SETLS proc predeclarations g := {[1,2],[2,3],[3,4],[4,1],[4,2],[3,5],[3,6],[5,6]}; print('initial graph: ',g); g +:= {[y,x]: [x,y] in g}; $form undirected graph print('Euler path: ',euler_path(g));
proc euler_path(g); $constructs eulerian path for graph g nodes := domain g; $all nodes in the graph if #(odds := {x in nodes | odd(#g{x})}) > 2 then print('too many odd ordered nodes'); return om; $since more than two nodes are end if; $touched by an odd number of edges
$odds is the set of all nodes of g that are touched by $an odd number of edges
x:= (arb odds) ? arb nodes; $pick a node of odds if possible $otherwise pick any node of g [start_p,g] := build_path(x,g); path := [x] + start_p;
(while exists z = path(i) | g{z}/={}) [new_p,g] := build_path(z,g); $insert new section into path path := path(1..i) + new_p + path(i+1 ..); end;
return path; end proc;
proc build_path(x,g); $builds maximal path section starting $at x, and deletes all edges traversed p := []; (while (y := arb g{x}) /= om) $while there exists an edge leaving $the last point traversed p with:= y; $extend path to traverse the edge g -:= {[x,y],[y,x]}; $delete the edge just traversed x := y; $step to y end; return [p,g]; $since g modified, return both end proc;
end prog;
program topsort1; proc tsort1; g:= {[1,4],[1,2],[2,4],[3,4],[2,3]}; nodes := domain g + range g; sorted := tsort1(g,nodes); print('Sorted list: ',sorted);
procedure tsort1(g,nodes); $topological sorting procedure, recursive form return if exists n in nodes | n notin range g then [n]+tsort1(g lessf n,nodes less n) else [] end; end proc;
end prog;
program topsort2; proc tsort2; g:= {[1,4],[1,2],[2,4],[3,4],[2,3]}; print('Sorted list: ',tsort2(g));
proc tsort2(g); $first iterative form of topological sort nodes := domain g + range g; t := []; $initialize tuple to be returned (while exists n in nodes | n notin range g) t with:=n; g lessf:=n; nodes less:= n; end; return t; end proc;
end prog;
program prime2; $ number is prime if no smaller integer divides it evenly print({x:x in [2..200] | (notexists k in [2..x-1] | x mod k = 0)}); end program;
$Sample program - Chapter 11.1 program euler; $ Eulerian path construction proc euler_path,build_path; $SETLS proc predeclarations var g; $permit use of g in procs g := {[1,2],[2,3],[3,4],[4,1],[4,2],[3,5],[3,6],[5,6]}; print('initial graph: ',g); g +:= {[y,x]: [x,y] in g}; $form undirected graph print('Euler path: ',euler_path);
proc euler_path; $constructs eulerian path for graph g nodes := domain g; $all nodes in the graph if #(odds := {x in nodes | odd(#g{x})}) > 2 then print('too many odd ordered nodes'); return om; $since more than two nodes are end if; $touched by an odd number of edges
$odds is the set of all nodes of g that are touched by $an odd number of edges
x:= (arb odds) ? arb nodes; $pick a node of odds if possible $otherwise pick any node of g path := [x] + build_path(x);
(while exists z = path(i) | g{z}/={}) new_p:=build_path(z); $insert new section into path path := path(1..i) + new_p + path(i+1 ..); end;
return path; end proc;
proc build_path(x); $builds maximal path section starting $at x, and deletes all edges traversed p := []; (while (y := arb g{x}) /= om) $while there exists an edge leaving $the last point traversed p with:= y; $extend path to traverse the edge g -:= {[x,y],[y,x]}; $delete the edge just traversed x := y; $step to y end; return p; end proc;
end prog;
References:
Schwartz, Jacob T. (1970) Schwartz, Jacob T. "Set Theory as a Language for Program Specification and Programming". Courant Institute of Mathematical Sciences, New York University, 1970.
Dickman, B. N.: Review of (1972) Dickman, B. N.: Review of "Symposium on some directions in high-level languages", May 22-23, 1972, New York University
in [SIGPLAN] (1972) SIGPLAN Notices 7(05) May 1972
Sammet (1972) Sammet, Jean E., "Roster of Programming Languages 1972" 251
in (1972) Computers & Automation 21(6B), 30 Aug 1972
Schwartz, Jacob T. (1972) Schwartz, Jacob T. "Abstract and Concrete Algorithms"
in (1972) Courant Symposium on High Level Level Languages, Computer Science Department of the Courant Institute of Mathematical Sciences, May 22, 1972
Shields, David (1972) Shields, David "Optimization Algorithms in a Set Theoretic Language"
in (1972) Courant Symposium on High Level Level Languages, Computer Science Department of the Courant Institute of Mathematical Sciences, May 22, 1972
Warren, Henry S. (1972) Warren, Henry S. "SETL Internals"
in (1972) Courant Symposium on High Level Level Languages, Computer Science Department of the Courant Institute of Mathematical Sciences, May 22, 1972
Morris, J.B. (1973) Morris, J.B. A Comparison of Madcap and SETL, Los Alamos Sci. Lab., University of California, Los Alamos, N. Mexico 1973
in (1972) Courant Symposium on High Level Level Languages, Computer Science Department of the Courant Institute of Mathematical Sciences, May 22, 1972
Sammet, Jean E. (1973) Sammet, Jean E. "Roster of Programming Languages for 1973" p147
in (1974) ACM Computing Reviews 15(04) April 1974
Schwartz, J. (1973) Schwartz, J. "On Programming, An Interim Report on the SETL Project", Computer Science Department, Courant Institute of Math. Sci., New York University (1973).
in (1974) ACM Computing Reviews 15(04) April 1974
Stock and Stock (1973) Stock, Marylene and Stock, Karl F. "Bibliography of Programming Languages: Books, User Manuals and Articles from PLANKALKUL to PL/I" Verlag Dokumentation, Pullach/Munchen 1973 530
Abstract in (1974) ACM Computing Reviews 15(04) April 1974
Franta, William R. and Kurt Maly (1974) Franta, William R. and Kurt Maly "Simulation Structures and SETL" pp208-212
in Rosenfeld, Jack L. (1974) Rosenfeld, Jack L. (Ed.): Information Processing 74, Proceedings of IFIP Congress 74, Stockholm, Sweden, August 5-10, 1974
Leavenworth and Sammet (1974) Leavenworth, Burt M.; Sammet, Jean E. "An overview of nonprocedural languages" pp1-12
AbstractExtract:
SETL and MADCAP in [VHLL 1974] (1974) Proceedings of the ACM SIGPLAN symposium on Very high level languages, March 28-29, 1974, Santa Monica, California, United States
Schwartz, J. T. (1974) Schwartz, J. T. "Automatic and semiautomatic optimization of SETL"
in [VHLL 1974] (1974) Proceedings of the ACM SIGPLAN symposium on Very high level languages, March 28-29, 1974, Santa Monica, California, United States
Schwartz, J. T. (1975) Schwartz, J. T. "Automatic data structure choice in a language of very high level"
Abstract in [ACM] (1975) [ACM] CACM 18(12) (Dec 1975)
Axford et al (1977) Axford, T.H., Diana Burkhardt, W.P. Dodd, Susan Laflin, D.G. Parkyn and P. Ramsay "ATOL:* A Simple Language with Powerful Data Structuring Facilities" Computer Centre, University of Birmingham, Birmingham U.K.
in [ACM] (1975) [ACM] CACM 18(12) (Dec 1975)
Dewar, Robert; Grand, Arthur; Liu, Cheng; Schonber (1978) Dewar, Robert; Grand, Arthur; Liu, Cheng; Schonberg, Edmond; and Schwartz, Jacob "SETL as a tool for generation of quality software" in "Constructing quality software" pp353-366
Abstract in Hibbard, P. (1978) Hibbard, P. G. and Schuman, S. A. (Eds.), Proc. IFIP working conference on constructing quality software, Elsevier North-Holland, Inc., New York, 1978
Dewar, Robert K.; Arthur and Ssu-Cheng Liu; and Sc (1979) Dewar, Robert K.; Arthur and Ssu-Cheng Liu; and Schwartz, Jacob T. and Schonberg, Edmond "Programming by Refinement, as Exemplified by the SETL Representation Sublanguage"
AbstractDOI in (1979) TOPLAS 1(1) Jan 1979
Schonberg, Edmond; Schwartz, Jacob T.; and Sharir, (1979) Schonberg, Edmond; Schwartz, Jacob T.; and Sharir, Micha
Automatic data structure selection in SETL.
in Conference record of the 6th annual ACM symposium on principles of programming languages (San Antonio, Texas, Jan. 29- 31. 1979), ACM, New York, 1979 pp197-210
in (1979) TOPLAS 1(1) Jan 1979
Barnard, D. (1980) Barnard, D. T., review of Dewar 1978
Extract:
Review in (1980) ACM Computing Reviews 21(02) Feb 1980
Davis, T. (1980) Davis, T. M. review of Schonberg 1979
Abstract in (1980) ACM Computing Reviews 21(11) November 1980
Robert B.K. Dewar, E. Schonberg, J.T. Schwartz, (1981) Robert B.K. Dewar, E. Schonberg, J.T. Schwartz, "Higher-level programming; introduction to the use of the set-theoretic programming language SETL", New York, Computer Science Department, Courant Institute of Mathematics, New York University, 1981
in (1980) ACM Computing Reviews 21(11) November 1980
Gries, D. and J. Prins (1985). (1985) Gries, D. and J. Prins (1985). "A new notion of encapsulation."
Abstract in [LIPE 1985] (1985) SIGPLAN Notices 20(07) July 1985 (Proceedings of the ACM SIGPLAN 85 symposium on Language issues in programming environments)
Schwartz, Jacob T. et al, (1986) Schwartz, Jacob T. et al, "Programming With Sets An Introduction to SETL", Springer 1986.
in [LIPE 1985] (1985) SIGPLAN Notices 20(07) July 1985 (Proceedings of the ACM SIGPLAN 85 symposium on Language issues in programming environments)