SETL
{{Short description|Programming language}}
{{Redirect|Setl|the indigenous location in Canada|Bridge River Rapids}}
{{Infobox programming language
| logo =
| paradigm = multi-paradigm: imperative, procedural, structured, object-oriented
| released = {{Start date and age|1969}}
| designer = (Jack) Jacob T. Schwartz
| developer = Courant Institute of Mathematical Sciences
| latest release version = 1.1
| latest release date = {{Start date and age|2005|01|07}}
| typing = Dynamic
| implementations =
| dialects =
| website = {{URL|setl.org}}
| influenced_by = ALGOL 60
| influenced = SETL2, ISETL, SETLX, Starset, ABC
}}
SETL (SET Language) is a very high-level programming language{{Cite journal |last=Schwartz |first=J. T. |last2=Dewar |first2=R. B. K. |last3=Schonberg |first3=E. |last4=Dubinsky |first4=E. |date=1986 |title=Programming with Sets |url=https://doi.org/10.1007/978-1-4613-9575-1 |journal=SpringerLink |language=en |pages=v-vii, 2, 48, 53, 57-58, 63, 113ff |doi=10.1007/978-1-4613-9575-1|url-access=subscription }} based on the mathematical theory of sets.{{Cite web |title=GNU SETL Om |url=https://setl.org/setl/doc/setl.html |access-date=2024-04-24 |website=setl.org}}{{Cite news |last=Markoff |first=John |date=2009-03-04 |title=Jacob T. Schwartz, 79, Restless Scientist, Dies |url=https://www.nytimes.com/2009/03/04/science/04schwartz.html |access-date=2024-04-24 |work=The New York Times |language=en-US |issn=0362-4331}} It was originally developed at the New York University (NYU) Courant Institute of Mathematical Sciences in the late 1960s, by a group containing (Jack) Jacob T. Schwartz, R.B.K. Dewar, and E. Schonberg. Schwartz is credited with designing the language.{{Cite book |url=https://link.springer.com/book/10.1007/978-0-85729-808-9 |title=Computational Logic and Set Theory |pages=vii |language=en |doi=10.1007/978-0-85729-808-9}}
Design
SETL provides two basic aggregate data types: (unordered) sets, and tuples.{{Cite web |title=CHAPTER 2 |url=https://www.settheory.com/Chapters/Chapter_2.html |access-date=2024-04-24 |website=www.settheory.com}} The elements of sets and tuples can be of any arbitrary type, including sets and tuples themselves, except the undefined value om (sometimes capitalized: OM).{{Cite web |title=CHAPTER 3 |url=https://www.settheory.com/Chapters/Chapter_3.html |access-date=2024-04-24 |website=www.settheory.com}} Maps are provided as sets of pairs (i.e., tuples of length 2) and can have arbitrary domain and range types. Primitive operations in SETL include set membership, union, intersection, and power set construction, among others.{{Cite web |title=CHAPTER 3 |url=https://www.settheory.com/Chapters/Chapter_3.html |access-date=2024-04-24 |website=www.settheory.com}}
SETL provides quantified boolean expressions constructed using the universal and existential quantifiers of first-order predicate logic.
SETL provides several iterators to produce a variety of loops over aggregate data structures.{{Cite web |title=CHAPTER 4 |url=https://www.settheory.com/Chapters/Chapter_4.html |access-date=2024-04-24 |website=www.settheory.com}}
Examples
Print all prime numbers from 2 to {{Var|N}}:
print([n in [2..N] | forall m in {2..n - 1} | n mod m > 0]);
The notation is similar to list comprehension.
A factorial procedure definition:
procedure factorial(n); -- calculates the factorial n!
return if n = 1 then 1 else n * factorial(n - 1) end if;
end factorial;
A more conventional SETL expression for factorial (n > 0):
*/[1..n]
Uses
Implementations of SETL were available on the CDC 6600, CDC Cyber, DEC VAX, IBM/370, SUN workstation and APOLLO.{{cite book
| title = Programming with sets. An Introduction to SETL
| author = J.T. Schwartz
| author2 = R.B.K. Dewar
| author3 = E. Dubinsky
| author4 = E. Schonberg
| publisher = Springer-Verlag New York Inc.
| year = 1986
| isbn = 978-1-4613-9577-5
| url = https://books.google.com/books?id=4pfbBwAAQBAJ&pg=PR6
}}
In the 1970s, SETL was ported to the BESM-6, ES EVM and other Russian computer systems.{{cite book
| title = Становление новосибирской школы программирования (мозаика воспоминаний)
| trans-title = Formation of the Novosibirsk school of programming (mosaic of memories)
| editor = И.В. Поттосин
| location = Новосибирск
| publisher = Институт систем информатики им. А. П. Ершова СО РАН
| year = 2001
| pages = 106–113
| url = https://www.iis.nsk.su/files/articles/mozaika.pdf
| language = ru
}}
SETL was used for an early implementation of the programming language Ada, named the NYU Ada/ED translator.{{cite book |first1=Robert B. K. |last1=Dewar |first2=Gerald A. |last2=Fisher Jr. |first3=Edmond |last3=Schonberg |first4=Robert |last4=Froelich |first5=Stephen |last5=Bryant |first6=Clinton F. |last6=Goss |first7=Michael |last7=Burke |title=Proceeding of the ACM-SIGPLAN symposium on Ada programming language - SIGPLAN '80 |chapter=The NYU Ada translator and interpreter |volume=15 |issue=11 |pages=194–201 |date=November 1980 |isbn=0-89791-030-3 |doi=10.1145/948632.948659|s2cid=10586359 }} This later became the first validated Ada implementation, certified on April 11, 1983.{{cite web |url=http://www.dtic.mil/docs/citations/ADA136759 |archive-url=https://web.archive.org/web/20170607044753/http://www.dtic.mil/docs/citations/ADA136759 |url-status=dead |archive-date=June 7, 2017 |title=Ada Compiler Validation Summary Report: NYU Ada/ED, Version 19.7 V-001 |author=SofTech Inc., Waltham, MA |date=1983-04-11 |access-date=2010-12-16}}
According to Guido van Rossum, "Python's predecessor, ABC, was inspired by SETL -- Lambert Meertens spent a year with the SETL group at NYU before coming up with the final ABC design!"[http://mail.python.org/pipermail/python-dev/2000-August/008881.html Python-Dev: SETL (was: Lukewarm about range literals)]
Language variants
SET Language 2 (SETL2), a backward incompatible descendant of SETL, was created by Kirk Snyder of the Courant Institute of Mathematical Sciences at New York University in the late 1980s.{{Cite web |title=SETL2 - EDM2 |url=http://www.edm2.com/index.php/SETL2 |access-date=2024-04-24 |website=www.edm2.com}} Like its predecessor, it is based on the theory and notation of finite sets, but has also been influenced in syntax and style by the Ada language.
Interactive SET Language (ISETL) is a variant of SETL used in discrete mathematics.{{Cite book |last=Baxter Hastings |first=Nancy |title=Learning discrete mathematics with ISETL |last2=Dubinsky |first2=Ed |last3=Levin |first3=Gary |date=1989 |publisher=Springer-Verlag |isbn=978-0-387-96898-8 |location=New York}}
GNU SETL is a command-line utility that extends and implements SETL.{{Cite web |title=GNU SETL |url=https://setl.org/setl/ |access-date=2024-04-24 |website=setl.org}}
References
{{Reflist}}
Further reading
- Schwartz, Jacob T., "Set Theory as a Language for Program Specification and Programming". Courant Institute of Mathematical Sciences, New York University, 1970.
- Schwartz, Jacob T., "On Programming, An Interim Report on the SETL Project", Computer Science Department, Courant Institute of Mathematical Sciences, New York University (1973).
- Schwartz, Jacob T., Dewar, R.B.K., Dubinsky, E., and Schonberg, E., Programming With Sets: An Introduction to SETL, 1986. {{ISBN|0-387-96399-5}}.
External links
- {{Official website}}
- [http://www.settheory.com Programming in SETL and other things]
- [http://www.softwarepreservation.org/projects/SETL SETL Historical Sources Archive]
{{Authority control}}
Category:Academic programming languages