Semantika, tuubid, loogika ja programmeerimine
|
|
- Berenice Ward
- 6 years ago
- Views:
Transcription
1 Sissejuhatus informaatikasse Semantika, tuubid, loogika ja programmeerimine Varmo Vene Arvutiteaduse Instituut Tartu Ulikool 5. mai 2009.
2 Tsitaat klassikutelt Sissejuhatus Everyone knows that debugging is twice as hard as writing a program in the rst place. So if you're as clever as you can be when you write it, how will you ever debug it? Brian Kernighan, P.J. Plauger "The Elements of Programming Style", 2ed., 1978.
3 Tsitaat klassikutelt Sissejuhatus Everyone knows that debugging is twice as hard as writing a program in the rst place. So if you're as clever as you can be when you write it, how will you ever debug it? Brian Kernighan, P.J. Plauger "The Elements of Programming Style", 2ed., aastat hiljem,... me kulutame ikkagi rohkem aega silumisele ja testimisele kui tegelikule programmeerimisele; sellele vaatamata sisaldavad meie kasutatavad ja/v~oi loodavad programmid vigu (teinekord vagagi ohtlikke).
4 V~oimalikke p~ohjuseid Human imperfection Sissejuhatus To err is human, to forgive divine. (Alexander Pope, 1688{1744) Laws of nature Program testing can be used to show the presence of bugs, but never to show their absence! (Edsger Dijkstra, 1970) Imperfection of tools The most eective debugging tool is still careful thought, coupled with judiciously placed print statements. (Brian Kernighan, 1979)
5 V~oimalikke p~ohjuseid Human imperfection Sissejuhatus To err is human, to forgive divine. (Alexander Pope, 1688{1744) Laws of nature Program testing can be used to show the presence of bugs, but never to show their absence! (Edsger Dijkstra, 1970) Imperfection of tools The most eective debugging tool is still careful thought, coupled with judiciously placed print statements. (Brian Kernighan, 1979)
6 V~oimalikke p~ohjuseid Human imperfection Sissejuhatus To err is human, to forgive divine. (Alexander Pope, 1688{1744) Laws of nature Program testing can be used to show the presence of bugs, but never to show their absence! (Edsger Dijkstra, 1970) Imperfection of tools The most eective debugging tool is still careful thought, coupled with judiciously placed print statements. (Brian Kernighan, 1979)
7 V~oimalikke p~ohjuseid Human imperfection Sissejuhatus To err is human, to forgive divine. (Alexander Pope, 1688{1744) Laws of nature Program testing can be used to show the presence of bugs, but never to show their absence! (Edsger Dijkstra, 1970) Imperfection of tools The most eective debugging tool is still careful thought, coupled with judiciously placed print statements. (Brian Kernighan, 1979)
8 Sissejuhatus Programmeerimiskeelte semantika uks eesmarke Selliste programmeerimist toetavate vahendite loomine, mis annaksid rangeid garantiisid programmi omaduste kohta. { Nait. garanteerib, et teatud liiki vigu programmis pole. Preventatiivsed meetodid { Nait. range tuubisusteemiga programmeerimiskeeled. Retroaktiivsed meetodid { Nait. staatilised programmianalusaatorid. Proaktiivsed meetodid { Nait. programmide sunteesimismeetodid.
9 Sissejuhatus Programmeerimiskeelte semantika uks eesmarke Selliste programmeerimist toetavate vahendite loomine, mis annaksid rangeid garantiisid programmi omaduste kohta. { Nait. garanteerib, et teatud liiki vigu programmis pole. Preventatiivsed meetodid { Nait. range tuubisusteemiga programmeerimiskeeled. Retroaktiivsed meetodid { Nait. staatilised programmianalusaatorid. Proaktiivsed meetodid { Nait. programmide sunteesimismeetodid.
10 Sissejuhatus Programmeerimiskeelte semantika uks eesmarke Selliste programmeerimist toetavate vahendite loomine, mis annaksid rangeid garantiisid programmi omaduste kohta. { Nait. garanteerib, et teatud liiki vigu programmis pole. Preventatiivsed meetodid { Nait. range tuubisusteemiga programmeerimiskeeled. Retroaktiivsed meetodid { Nait. staatilised programmianalusaatorid. Proaktiivsed meetodid { Nait. programmide sunteesimismeetodid.
11 Sissejuhatus Programmeerimiskeelte semantika uks eesmarke Selliste programmeerimist toetavate vahendite loomine, mis annaksid rangeid garantiisid programmi omaduste kohta. { Nait. garanteerib, et teatud liiki vigu programmis pole. Preventatiivsed meetodid { Nait. range tuubisusteemiga programmeerimiskeeled. Retroaktiivsed meetodid { Nait. staatilised programmianalusaatorid. Proaktiivsed meetodid { Nait. programmide sunteesimismeetodid.
12 Tuubid Ulevaade { Dunaamiline vs. staatiline tuupimine { Parameetriline ja "ad-hoc" polumorsm Loogika ja programmeerimine { Klassikaline vs. konstruktiivne loogika { Intuitsionistlik lausearvutus { Curry-Howard'i vastavus { Programmide suntees ja ektraheerimine
13 Tuubid Mida teeb jargmine programmil~oik? x 1 := "Pii siinus on: "; x 2 := 3: ; : : : print x 2 ; print (sin(x 1 ));
14 Tuubid Mida teeb jargmine programmil~oik? x 1 := "Pii siinus on: "; x 2 := 3: ; : : : print x 2 ; print (sin(x 1 )); Vastus Ei tea (loodetavasti siiski mitte midagi vaga hullu :)
15 Tuubid Mida teeb jargmine programmil~oik? x 1 := "Pii siinus on: "; x 2 := 3: ; : : : print x 2 ; print (sin(x 1 )); Milleks tuubid? Peaeesmark on valtida selliste vigade tekkimist Idee: { Seome vaartustega/muutujatega/... tuubid { Kontrollime, kas tuubid klapivad Dunaamiline tuupimine Staatiline tuupimine
16 Dunaamiline tuupimine Tuubid Tuubikontroll toimub programmi taitmise ajal x Int 123 APL, Lisp, Perl, Python, Ruby, Tcl/Tk,... Vaga paindlik Ebaefektiivne Tuubivigade leidmine raske
17 Staatiline tuupimine Tuubid Tuubikontroll toimub programmi transleerimise ajal x Int 123 Fortran, Algol, Pascal, C, Java, Haskell,... Tuubivigade leidmine lihtne Efektiivne Tugevalt kitsendav, aga...
18 Staatiline tuupimine Probleem Baastuubid Struktuurid Algoritmid Int List size Char... Tree... sort...
19 Lahendused Staatiline tuupimine Lepime olukorraga (Pascal) Petame tuubisusteemi (C) Kasutame v~oimsamat tuubisusteemi { Geneeriline programmeerimine (Ada, C++, Java) { Polumorsm (ML, Haskell) { Polutuupsus (Polyp, Generic Haskell) { S~oltuvad tuubid (Epigram, Agda)
20 Lahendused Staatiline tuupimine Lepime olukorraga (Pascal) Petame tuubisusteemi (C) Kasutame v~oimsamat tuubisusteemi { Geneeriline programmeerimine (Ada, C++, Java) { Polumorsm (ML, Haskell) { Polutuupsus (Polyp, Generic Haskell) { S~oltuvad tuubid (Epigram, Agda)
21 Lahendused Staatiline tuupimine Lepime olukorraga (Pascal) Petame tuubisusteemi (C) Kasutame v~oimsamat tuubisusteemi { Geneeriline programmeerimine (Ada, C++, Java) { Polumorsm (ML, Haskell) { Polutuupsus (Polyp, Generic Haskell) { S~oltuvad tuubid (Epigram, Agda)
22 Lahendused Staatiline tuupimine Lepime olukorraga (Pascal) Petame tuubisusteemi (C) Kasutame v~oimsamat tuubisusteemi { Geneeriline programmeerimine (Ada, C++, Java) { Polumorsm (ML, Haskell) { Polutuupsus (Polyp, Generic Haskell) { S~oltuvad tuubid (Epigram, Agda)
23 Polumorsm Staatiline tuupimine Programm on parametriseeritud tuubi suhtes (1 + 2) == 3 =) True [1; 2; 3] == [4; 5] =) False length [1; 2; 3] =) 3 length ["Abc"; ""; "efg"; "hj"] =) 4 "Ad-hoc" polumorsm Parameetriline (universaalne) polumorsm
24 Polumorsm "Ad-hoc" polumorsm Deneeritud induktsiooniga ule tuubivaljendi Erinevate tuupide jaoks erinev realisatsioon equal Int i 1 i 2 = priminteq i 1 i 2 equal [a] [ ] [ ] = True equal [a] (x : xs) (y : ys) = equal a x y && equal [a] xs ys equal [a] xs ys = False
25 Parameetriline polumorsm Polumorsm Uks denitsioon k~oigi tuupide jaoks length :: [a]! Int length [ ] = 0 length (x : xs) = 1 + length xs map :: (a! b)! [a]! [b] map f [ ] = [ ] map f (x : xs) = f x : map f xs
26 "Tasuta" teoreemid Prameetriline polumorsm length (map f xs) = length xs
27 "Tasuta" teoreemid Prameetriline polumorsm length (map f xs) = length xs "Tasuta" denitsioonid Mis funktsioon on tuupi (a; b)! (b; a)? Vastus: swap (x; y) = (y; x)... ja ainult swap!! Mis funktsioon on tuupi (Int; Char)! (Char; Int)? Neid on palju; naiteks swap, aga ka boo (x; y) = ( 0 A 0 ; 13) foo (x; y) = (ord x; chr y)
28 "Tasuta" teoreemid Prameetriline polumorsm length (map f xs) = length xs "Tasuta" denitsioonid Mis funktsioon on tuupi (a; b)! (b; a)? Vastus: swap (x; y) = (y; x)... ja ainult swap!! Mis funktsioon on tuupi (Int; Char)! (Char; Int)? Neid on palju; naiteks swap, aga ka boo (x; y) = ( 0 A 0 ; 13) foo (x; y) = (ord x; chr y)
29 "Tasuta" teoreemid Prameetriline polumorsm length (map f xs) = length xs "Tasuta" denitsioonid Mis funktsioon on tuupi (a; b)! (b; a)? Vastus: swap (x; y) = (y; x)... ja ainult swap!! Mis funktsioon on tuupi (Int; Char)! (Char; Int)? Neid on palju; naiteks swap, aga ka boo (x; y) = ( 0 A 0 ; 13) foo (x; y) = (ord x; chr y)
30 "Tasuta" teoreemid Prameetriline polumorsm length (map f xs) = length xs "Tasuta" denitsioonid Mis funktsioon on tuupi (a; b)! (b; a)? Vastus: swap (x; y) = (y; x)... ja ainult swap!! Mis funktsioon on tuupi (Int; Char)! (Char; Int)? Neid on palju; naiteks swap, aga ka boo (x; y) = ( 0 A 0 ; 13) foo (x; y) = (ord x; chr y)
31 "Tasuta" teoreemid Prameetriline polumorsm length (map f xs) = length xs "Tasuta" denitsioonid Mis funktsioon on tuupi (a; b)! (b; a)? Vastus: swap (x; y) = (y; x)... ja ainult swap!! Mis funktsioon on tuupi (Int; Char)! (Char; Int)? Neid on palju; naiteks swap, aga ka boo (x; y) = ( 0 A 0 ; 13) foo (x; y) = (ord x; chr y)
32 Loogika? Vikipeedia (et.wikipedia.org ) Loogika on teadus m~otlemise reeglitest, struktuuridest ja vormidest. Formaalne loogika tegeleb sellega, kuidas jareldada t~oestest vaidetest t~oeseid vaiteid, kuid reeglina ei utle, millised vaited on t~oesed. Seet~ottu oeldakse, et formaalsel loogikal puudub sisu: ta ei utle midagi selle kohta, missugune maailm tegelikult on.
33 Loogika? Vikipeedia (et.wikipedia.org ) Loogika on teadus m~otlemise reeglitest, struktuuridest ja vormidest. Formaalne loogika tegeleb sellega, kuidas jareldada t~oestest vaidetest t~oeseid vaiteid, kuid reeglina ei utle, millised vaited on t~oesed. Seet~ottu oeldakse, et formaalsel loogikal puudub sisu: ta ei utle midagi selle kohta, missugune maailm tegelikult on.
34 Loogika? Vikipeedia (et.wikipedia.org ) Loogika on teadus m~otlemise reeglitest, struktuuridest ja vormidest. Formaalne loogika tegeleb sellega, kuidas jareldada t~oestest vaidetest t~oeseid vaiteid, kuid reeglina ei utle, millised vaited on t~oesed. Seet~ottu oeldakse, et formaalsel loogikal puudub sisu: ta ei utle midagi selle kohta, missugune maailm tegelikult on.
35 Loogika Klassikaline loogika Iga vaide on kas t~oene v~oi vaar. P~ohikusimus: "Kas antud vaide on t~oene v~oi vaar?"
36 Loogika Klassikaline loogika Iga vaide on kas t~oene v~oi vaar. P~ohikusimus: "Kas antud vaide on t~oene v~oi vaar?" Konstruktiivne loogika Vaide on t~oene ainult siis, kui me oskame seda t~oestada. P~ohikusimus: "Kuidas antud vaide muutub t~oeseks?" Sealhulgas, kui vaide vaidab millegi leidumist, siis peame oskama naidata vahemalt uhe konkreetse objekti mis selle vaite jargi leidub.
37 Loogika Klassikaline vs. konstruktiivne loogika Alljargnevad vaited on klassikaliselt tautoloogiad, kuid konstruktiivselt ei kehti: A _ :A ::A A ((A B) A) A
38 Loogika Lausearvutuse suntaks P ::= A j P ^ P j P _ P j P P j > j? Tuletusreeglid Tuletusreeglite uldkuju: P 1 P 2 : : : Pn P 0 Valemid P 1, P 2,..., P n on eeldused; valem P 0 on jareldus.
39 Tuletusreeglid Tuletusreeglite uldkuju: Loogika P 1 P 2 : : : Pn P 0 Iga konnektiivi (^, _,,... ) jaoks on kahesugused reeglid. Sissetoomisreeglid: { konnektiiv asub jarelduses P 0 ; { "kuidas jarelduse kehtivust naidata?" Valjaviimisreeglid: { konnektiiv asub eelduses P i ; { "kuidas olemasolevat t~oestust ara kasutada?"
40 Loogika Tuletusreeglid: konjunktsioon Sissetoomisreegel: P 1 P 2 P 1 ^ P 2 Valjaviimisreeglid: P 1 ^ P 2 P 1 P 1 ^ P 2 P 2
41 Tuletusreeglid: implikatsioon Sissetoomisreegel: Loogika P 1. P 2 P 1 P 2 Valjaviimisreegel: P 1 P 2 P 1 P 2
42 Tuletusreeglid: disjunktsioon Sissetoomisreeglid: Loogika P 1 P 1 _ P 2 P 2 P 1 _ P 2 Valjaviimisreegel: P 1 _ P 2 P 1. P 0 P 2. P 0 P 0
43 Loogika Tuletusreeglid: t~ode ja vastuolu Sissetoomisreegel: > Valjaviimisreegel:? P
44 Loogika A ^ B B ^ A
45 Loogika A ^ B B ^ A A ^ B B ^ A
46 Loogika A ^ B A ^ B B A B ^ A A ^ B B ^ A
47 Loogika A ^ B A ^ B B A B ^ A A ^ B B ^ A
48 Loogika snd A ^ B fst A ^ B B A B ^ A A ^ B B ^ A
49 Loogika A ^ B snd B pair B ^ A fst A ^ B A A ^ B B ^ A
50 Loogika x A ^ B snd B pair x: x fst B ^ A A ^ B B ^ A A ^ B A
51 Loogika x A ^ B snd snd x B pair x: x A ^ B fst fst x A B ^ A A ^ B B ^ A
52 Loogika x A ^ B x A ^ B snd fst snd x B fst x A pair pair (snd x; fst x) B ^ A x: A ^ B B ^ A
53 Loogika x A ^ B snd snd x B pair pair (snd x; fst x) x: x A ^ B fst fst x A B ^ A x: pair (snd x; fst x) A ^ B B ^ A
54 Loogika x A ^ B snd snd x B pair pair (snd x; fst x) x: x A ^ B fst fst x A B ^ A x: pair (snd x; fst x) A ^ B B ^ A T~oestamine ON programmeerimine!! swap x = (snd x; fst x)
55 Loogika ja programmeerimine Curry-Howard'i vastavus Loogika valem lausemuutuja t~oestus eeldus loogiline konnektiiv t~oestatavus normaliseerimine -arvutus tuup tuubimuutuja term termimuutuja tuubikonstruktor asustatavus reduktsioon
56 Loogika ja programmeerimine Curry-Howard'i vastavuse rakendused Programmide suntees: { ulesanne spetsitseeritakse mingi loogika valemina; { antud valem t~oestatakse automaatselt susteemi poolt; { t~oestusi t~olgendatakse programmina. { Nait. mitmed Enn T~ougu poolt arendatud susteemid (Priz, Nut, Cocovila).
57 Loogika ja programmeerimine Curry-Howard'i vastavuse rakendused T~oestusassistendid { Nait. Isabelle/HOL, Coq { Kasutavad spetsiaalseid programmeerimiskeeli t~oestuste kirjutamiseks. { V~oimaldavad t~oestustest programme ekstraheerida (eraldada t~oestustest arvutuslikult oluline osa). Tuubiteoorial baseeruvad programmeerimiskeeled { Nait. Epigram, Agda { On reaalsed programmeerimiskeeled, kus "programmeerimine" ja "t~oestamine" on uks ja sama.
58 Loogika ja programmeerimine Curry-Howard'i vastavuse rakendused T~oestusassistendid { Nait. Isabelle/HOL, Coq { Kasutavad spetsiaalseid programmeerimiskeeli t~oestuste kirjutamiseks. { V~oimaldavad t~oestustest programme ekstraheerida (eraldada t~oestustest arvutuslikult oluline osa). Tuubiteoorial baseeruvad programmeerimiskeeled { Nait. Epigram, Agda { On reaalsed programmeerimiskeeled, kus "programmeerimine" ja "t~oestamine" on uks ja sama.
Milleks tüübid? Mida teeb järgmine programmijupp? x 1 := "Pii siinus on : "; x 2 := ; printx 2 ; print(sin(x 1 ));
Milleks tüübid? Mida teeb järgmine programmijupp? x 1 := "Pii siinus on : "; x 2 := 3.1415926;... printx 2 ; print(sin(x 1 )); Ei tea (loodetavasti siiski mitte midagi väga hullu :-) VARMO VENE 1 Milleks
More informationPuudub protseduur. Protseduuri nimi võib olla valesti kirjutatud. Protseduuri (või funktsiooni) poole pöördumisel on vähem argumente kui vaja.
Puudub protseduur. Protseduuri nimi võib olla valesti kirjutatud. Sub prog1() Msgox "Tere" Sub prog2() a = si(1) Protseduuri (või funktsiooni) poole pöördumisel on vähem argumente kui vaja. a = Sin() Protseduuri
More informationTopic 9: Type Checking
Recommended Exercises and Readings Topic 9: Type Checking From Haskell: The craft of functional programming (3 rd Ed.) Exercises: 13.17, 13.18, 13.19, 13.20, 13.21, 13.22 Readings: Chapter 13.5, 13.6 and
More informationTopic 9: Type Checking
Topic 9: Type Checking 1 Recommended Exercises and Readings From Haskell: The craft of functional programming (3 rd Ed.) Exercises: 13.17, 13.18, 13.19, 13.20, 13.21, 13.22 Readings: Chapter 13.5, 13.6
More informationSQL Server 2005 Expressi paigaldamine
SQL Server 2005 Expressi paigaldamine Laadige alla.net Framework 2.0 http://www.microsoft.com/downloads/details.aspx?familyid=0856eacb-4362-4b0d- 8edd-aab15c5e04f5 Avage http://www.microsoft.com/express/2005/sql/download/default.aspx
More informationVea haldus ja logiraamat hajutatud süsteemides Enn Õunapuu.
Vea haldus ja logiraamat hajutatud süsteemides Enn Õunapuu enn.ounapuu@ttu.ee Millest tuleb jutt? Kuidas ma näen, millises sammus erinevad protsessid parasjagu on? Kuidas ma aru saan, kas protsess töötab
More informationCOMP1730/COMP6730 Programming for Scientists. Testing and Debugging.
COMP1730/COMP6730 Programming for Scientists Testing and Debugging. Overview * Testing * Debugging * Defensive Programming Overview of testing * There are many different types of testing - load testing,
More informationFunctional Programming and Haskell
Functional Programming and Haskell Tim Dawborn University of Sydney, Australia School of Information Technologies Tim Dawborn Functional Programming and Haskell 1/22 What are Programming Paradigms? A programming
More informationErik Jõgi. twitter.com/erikjogi twitter.com/codeborne
Disain Erik Jõgi erik@codeborne.com twitter.com/erikjogi twitter.com/codeborne Disain? Miks? Bad code Clean Code A Handbook of Agile Software Craftsmanship Robert C. Martin, 2008 Uncle Bob You know you
More informationMälu interfeisid Arvutikomponendid Ergo Nõmmiste
Mälu interfeisid Arvutikomponendid Ergo Nõmmiste Mälu liigid Read-only memory (ROM) Flash memory (EEPROM) Static random access memory (SRAM) Dynamic random access memoty (DRAM) 1 kbaidine mälu vajab 10
More informationLõimed. Lõime mõiste. Lõimede mudelid. Probleemid lõimedega seoses. Pthreads. Solarise lõimed. Windowsi lõimed. FreeBSD lõimed.
Lõimed Lõime mõiste Lõimede mudelid Probleemid lõimedega seoses Pthreads Solarise lõimed Windowsi lõimed FreeBSD lõimed Linuxi lõimed MEELIS ROOS 1 Ühe- ja mitmelõimelised protsessid code data files code
More informationFUNKTSIONAALNE PROGRAMMEERIMINE. Animatsioonid
Animatsioon on liikuv, ehk ajast sõltuv, graafika Liikumise illusioon saavutatakse sellega, et teatud ajavahemike järel (optimaalseks peetakse 30 freimi sekundis) joonistatakse erineva pildiga uus freim
More informationProgramming Languages Fall 2013
Programming Languages Fall 2013 Lecture 2: types Prof. Liang Huang huang@qc.cs.cuny.edu Recap of Lecture 1 functional programming vs. imperative programming basic Haskell syntax function definition lazy
More informationEESTI STANDARD EVS-ISO 11620:2010
EESTI STANDARD EVS-ISO INFORMATSIOON JA DOKUMENTATSIOON Raamatukogu tulemusindikaatorid Information and documentation Library performance indicators (ISO 11620:2008) EVS-ISO EESTI STANDARDI EESSÕNA NATIONAL
More informationDependent Polymorphism. Makoto Hamana
1 Dependent Polymorphism Makoto Hamana Department of Computer Science, Gunma University, Japan http://www.cs.gunma-u.ac.jp/ hamana/ This Talk 2 [I] A semantics for dependently-typed programming [II] A
More informationAndmebaasid (6EAP) I praktikum
Andmebaasid (6EAP) I praktikum Mõisteid Server on arvutisüsteem või selles töötav tarkvara, mis pakub teatud infoteenust sellega ühenduvatele klientidele. Klient on tarkvara, mis võimaldab suhelda serveriga.
More informationLambda-termide redutseerimine
Lambda-termid type Var = String data Term = Var Var App Term Term Lam Var Term Vabade muutujate leidmine freevars :: Term -> [Var] freevars (Var x) = [x] freevars (App e1 e2) = freevars e1 union freevars
More informationEESTI STANDARD EVS-ISO/IEC 27003:2011
EESTI STANDARD EVS-ISO/IEC 27003:2011 INFOTEHNOLOOGIA Turbemeetodid Infoturbe halduse süsteemi teostusjuhis Information technology Security techniques Information security management system Implementation
More informationInformal Semantics of Data. semantic specification names (identifiers) attributes binding declarations scope rules visibility
Informal Semantics of Data semantic specification names (identifiers) attributes binding declarations scope rules visibility 1 Ways to Specify Semantics Standards Documents (Language Definition) Language
More informationXmlHttpRequest asemel võib olla vajalik objekt XDomainRequest
1 2 3 XmlHttpRequest asemel võib olla vajalik objekt XDomainRequest 4 5 6 7 8 https://www.trustwave.com/global-security-report http://redmondmag.com/articles/2012/03/12/user-password-not-sophisticated.aspx
More informationDspace, milleks. -säilitamine, pikaajaline -avaldamine, kohe, ruttu ja kõikjale
Dspace, milleks -säilitamine, pikaajaline -avaldamine, kohe, ruttu ja kõikjale Failiformaadid: txt, odt, doc, docx, mpeg,...üle 60 Fail ja selle metaandmed moodustavad terviku (item) Originaalfail muutmatu
More informationCSc 372 Comparative Programming Languages
CSc 372 Comparative Programming Languages The University of Arizona Fall Semester, 2006 CSc 372, Fall 2006 Introduction Slide 1 CSc 372, Fall 2006 Introduction Slide 2 Introduction Instructor Teaching
More informationG Programming Languages - Fall 2012
G22.2110-003 Programming Languages - Fall 2012 Lecture 3 Thomas Wies New York University Review Last week Names and Bindings Lifetimes and Allocation Garbage Collection Scope Outline Control Flow Sequencing
More informationSpring & AOP. Margus Jäger Lauri Tulmin
Spring & AOP Margus Jäger Lauri Tulmin 1 Sissejuhatus 3. peatükk raamatus Spring in Action 4. peatükk raamatus Professional Java Development with the Spring Framework Spring Spring AOP Võrdlus AspectJ
More informationPROGRAMMING IN HASKELL. Chapter 5 - List Comprehensions
PROGRAMMING IN HASKELL Chapter 5 - List Comprehensions 0 Set Comprehensions In mathematics, the comprehension notation can be used to construct new sets from old sets. {x 2 x {1...5}} The set {1,4,9,16,25}
More informationCSC 326H1F, Fall Programming Languages. What languages do you know? Instructor: Ali Juma. A survey of counted loops: FORTRAN
What languages do you know? CSC 326H1F, Programming Languages The usual suspects: C, C++, Java fine languages nearly the same Perhaps you've also learned some others? assembler Basic, Visual Basic, Turing,
More information2
1 2 3 4 5 St. seotud grupid 6 7 Soovitused: Vältida sidusgruppide tähtsuse järgi järjestamist. Minimeerige üksikute sidusgruppide esiletõstmist. 8 9 10 11 12 Päästeameti avalik veebileht (www.päästeamet.ee)
More informationLanguages october 22, 2017 Éric Lévénez <http://www.levenez.com/lang/> FORTRAN III end-1958 FORTRAN II FORTRAN I october 1956
1954 1957 FORTRAN november 1954 FORTRAN I october 1956 FORTRAN II 1957 FORTRAN III end-1958 B-O 1957 Flow-Matic 1958 COBOL 1959 JOVIAL 1959 IAL 1958 ALGOL 58 1958 Lisp 1958 Lisp 1 1959 Languages october
More informationLecture 1: Course Introduction
Lecture 1: Course Introduction CS164: Programming Languages and Compilers P. N. Hilfinger, 787 Soda Spring 2015 Acknowledgement. Portions taken from CS164 notes by G. Necula. Last modified: Wed Jan 21
More informationPrinciples of Programming Languages
Principles of Programming Languages h"p://www.di.unipi.it/~andrea/dida2ca/plp-16/ Prof. Andrea Corradini Department of Computer Science, Pisa Lesson 24! Type inference in ML / Haskell 1 Type Checking vs
More informationCOMP 201: Principles of Programming
COMP 201: Principles of Programming 1 Learning Outcomes To understand what computing entails and what the different branches of computing are. To understand the basic design of a computer and how it represents
More informationPC204. Lecture 5 Programming Methodologies. Copyright 2000 by Conrad Huang and the Regents of the University of California. All rights reserved.
PC204 Lecture 5 Programming Methodologies Copyright 2000 by Conrad Huang and the Regents of the University of California. All rights reserved. Programming Paradigms Software Engineering Exploratory Programming
More informationProgrammeerimiskeeled. Sissejuhatus informaatikasse Aivar Annamaa 28. november 2012
Programmeerimiskeeled Sissejuhatus informaatikasse Aivar Annamaa 28. november 2012 Mis on programmeerimiskeeled? Miks on prog.keeli nii palju? Kuidas prog.keeli tehakse? Milleks programmeerimiskeeled?
More informationA Tour of Language Implementation
1 CSCE 314: Programming Languages Dr. Flemming Andersen A Tour of Language Implementation Programming is no minor feat. Prometheus Brings Fire by Heinrich Friedrich Füger. Image source: https://en.wikipedia.org/wiki/prometheus
More informationTYPES OF PROGRAMMING LANGUAGES
TYPES OF PROGRAMMING LANGUAGES PRINCIPLES OF PROGRAMMING LANGUAGES Norbert Zeh Winter 2018 Dalhousie University 1/30 REASONS TO CHOOSE A PARTICULAR PROGRAMMING LANGUAGE 2/30 REASONS TO CHOOSE A PARTICULAR
More informationTypes and Type Inference
Types and Type Inference Mooly Sagiv Slides by Kathleen Fisher and John Mitchell Reading: Concepts in Programming Languages, Revised Chapter 6 - handout on the course homepage Outline General discussion
More informationSoftware System Design and Implementation
Software System Design and Implementation Functional Programming Gabriele Keller The University of New South Wales School of Computer Science and Engineering Sydney, Australia COMP3141 16s1 Course software
More informationTesting. Wouter Swierstra and Alejandro Serrano. Advanced functional programming - Lecture 2. [Faculty of Science Information and Computing Sciences]
Testing Advanced functional programming - Lecture 2 Wouter Swierstra and Alejandro Serrano 1 Program Correctness 2 Testing and correctness When is a program correct? 3 Testing and correctness When is a
More informationNAS, IP-SAN, CAS. Loeng 4
NAS, IP-SAN, CAS Loeng 4 Tunniteemad Network Attached Storage IP Storage Attached Network Content Addressed Storage Network Attached Storage Tehnoloogia, kus andmed on jagatud üle võrgu Salvestusvahendile
More informationCS 330 Lecture 18. Symbol table. C scope rules. Declarations. Chapter 5 Louden Outline
CS 0 Lecture 8 Chapter 5 Louden Outline The symbol table Static scoping vs dynamic scoping Symbol table Dictionary associates names to attributes In general: hash tables, tree and lists (assignment ) can
More informationAndroidi rakenduste ligipääsu õigused
Tallinna Ülikool Digitehnoloogiate Instituut Androidi rakenduste ligipääsu õigused Seminaritöö Autor: Martin Kütt Juhendaja: Jaagup Kippar Autor:...... 2017 Juhendaja:...... 2017 Instituudi direktor:......
More informationStandard prelude. Appendix A. A.1 Classes
Appendix A Standard prelude In this appendix we present some of the most commonly used definitions from the standard prelude. For clarity, a number of the definitions have been simplified or modified from
More informationSKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG)
SKILL AREA 304: Review Programming Language Concept Computer Programming (YPG) 304.1 Demonstrate an Understanding of Basic of Programming Language 304.1.1 Explain the purpose of computer program 304.1.2
More informationTARTU ÜLIKOOL. Arvutiteaduse instituut LOODUS- JA TÄPPISTEADUSTE VALDKOND
TARTU ÜLIKOOL Arvutiteaduse instituut LOODUS- JA TÄPPISTEADUSTE VALDKOND Anita Scharonberg CVE-2015-3457 Referaat Juhendaja: Meelis Roos Tartu 2016 SISUKORD 1 Sissejuhatus... 3 2 Turvaauk... 3 3 Turvaaugu
More informationWD My Net N600 juhend:
WD My Net N600 juhend: 1) Kui WD My Net N600 seade on ühendatud näiteks Elioni Thomsoni ruuteriga (TG789vn või TG784) või Elioni Inteno DG301a ruuteriga, kus üldiselt on ruuteri Default Gateway sama, nagu
More informationQuickCheck, SmallCheck & Reach: Automated Testing in Haskell. Tom Shackell
QuickCheck, SmallCheck & Reach: Automated Testing in Haskell By Tom Shackell A Brief Introduction to Haskell Haskell is a purely functional language. Based on the idea of evaluation of mathematical functions
More informationInformatics 1 Functional Programming Lecture 5. Function properties. Don Sannella University of Edinburgh
Informatics 1 Functional Programming Lecture 5 Function properties Don Sannella University of Edinburgh Part I Booleans and characters Boolean operators not :: Bool -> Bool (&&), ( ) :: Bool -> Bool ->
More informationTypes and Type Inference
CS 242 2012 Types and Type Inference Notes modified from John Mitchell and Kathleen Fisher Reading: Concepts in Programming Languages, Revised Chapter 6 - handout on Web!! Outline General discussion of
More informationSoftware System Design and Implementation
Software System Design and Implementation Property-based Testing Gabriele Keller The University of New South Wales School of Computer Science and Engineering Sydney, Australia COMP3141 17s1 Testing in
More informationCSE 374 Programming Concepts & Tools. Hal Perkins Fall 2015 Lecture 15 Testing
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 15 Testing Where we are Some very basic software engineering topics in the midst of tools Today: testing (how, why, some terms) Later:
More informationLogic - CM0845 Introduction to Haskell
Logic - CM0845 Introduction to Haskell Diego Alejandro Montoya-Zapata EAFIT University Semester 2016-1 Diego Alejandro Montoya-Zapata (EAFIT University) Logic - CM0845 Introduction to Haskell Semester
More informationLecture 1: Course Introduction
Lecture 1: Course Introduction CS164: Programming Languages and Compilers P. N. Hilfinger, 787 Soda Fall 2013 Acknowledgement. Portions taken from CS164 notes by G. Necula. Last modified: Thu Aug 29 16:03:34
More informationTopic I. Introduction and motivation References: Chapter 1 of Concepts in programming languages by J. C. Mitchell. CUP, 2003.
Topic I Introduction and motivation References: Chapter 1 of Concepts in programming languages by J. C. Mitchell. CUP, 2003. Chapter 1 of Programming languages: Design and implementation (3RD EDITION)
More informationChapter 5. Names, Bindings, and Scopes
Chapter 5 Names, Bindings, and Scopes Chapter 5 Topics Introduction Names Variables The Concept of Binding Scope Scope and Lifetime Referencing Environments Named Constants 1-2 Introduction Imperative
More informationCSCE 314 Programming Languages
CSCE 314 Programming Languages Final Review Part I Dr. Hyunyoung Lee 1 Programming Language Characteristics Different approaches to describe computations, to instruct computing devices E.g., Imperative,
More informationTuples. CMSC 330: Organization of Programming Languages. Examples With Tuples. Another Example
CMSC 330: Organization of Programming Languages OCaml 2 Higher Order Functions Tuples Constructed using (e1,..., en) Deconstructed using pattern matching Patterns involve parens and commas, e.g., (p1,p2,
More informationProgrammeerimine. 3. loeng
Programmeerimine 3. loeng Tana loengus T~oevaartustuup ja loogilised avaldised Hargnemisdirektiivid { Lihtne if-lause { if-else-lause { Uldkujuline if-lause Tsuklidirektiivid { Eelkontrolliga tsukkel {
More informationConcepts in Programming Languages
Concepts in Programming Languages Marcelo Fiore Computer Laboratory University of Cambridge 2012 2013 (Easter Term) 1 Practicalities Course web page: with lecture
More informationDesign Issues. Subroutines and Control Abstraction. Subroutines and Control Abstraction. CSC 4101: Programming Languages 1. Textbook, Chapter 8
Subroutines and Control Abstraction Textbook, Chapter 8 1 Subroutines and Control Abstraction Mechanisms for process abstraction Single entry (except FORTRAN, PL/I) Caller is suspended Control returns
More informationA general introduction to Functional Programming using Haskell
A general introduction to Functional Programming using Haskell Matteo Rossi Dipartimento di Elettronica e Informazione Politecnico di Milano rossi@elet.polimi.it 1 Functional programming in a nutshell
More informationSoftware II: Principles of Programming Languages. Why Expressions?
Software II: Principles of Programming Languages Lecture 7 Expressions and Assignment Statements Why Expressions? Expressions are the fundamental means of specifying computations in a programming language
More informationINF 212 ANALYSIS OF PROG. LANGS ELEMENTS OF IMPERATIVE PROGRAMMING STYLE. Instructors: Crista Lopes Copyright Instructors.
INF 212 ANALYSIS OF PROG. LANGS ELEMENTS OF IMPERATIVE PROGRAMMING STYLE Instructors: Crista Lopes Copyright Instructors. Objectives Level up on things that you may already know Machine model of imperative
More informationIT infrastruktuuri teenused. Failiserver. Margus Ernits
IT infrastruktuuri teenused Failiserver Margus Ernits margus.ernits@itcollege.ee 1 Failide hoidmine kasutaja arvutis pole tihti mõistlik, kuna Failiserver Arvuti kõvaketta hävimisega kaovad andmed ja nendest
More informationFaith, Evolution, and Programming Languages. Philip Wadler University of Edinburgh
Faith, Evolution, and Programming Languages Philip Wadler University of Edinburgh Evolution Multiculturalism Part I Church: The origins of faith Gerhard Gentzen (1909 1945) Gerhard Gentzen (1935) Natural
More informationNames, Scopes, and Bindings II. Hwansoo Han
Names, Scopes, and Bindings II Hwansoo Han Scope Rules A scope is textual region where bindings are active A program section of maximal size Bindings become active at the entry No bindings change in the
More informationProgramming Paradigms Languages F28PL, Lecture 1
Programming Paradigms Languages F28PL, Lecture 1 Jamie Gabbay October 14, 2016 1 / 37 About me My name is Murdoch James Gabbay everybody calls me Jamie. I got a PhD in Cambridge in 2001. Since then I have
More informationCourse outline. CSE 341: Programming Languages. Why study programming languages? Course motivation and objectives. 1 lecture: Concepts
CSE 341: Programming Languages Course outline Explore several other programming paradigms 1 lecture: Concepts ML, Scheme,...: functional programming, lists, recursion, pattern-matching, polymorphic typing,
More informationPinu põhine puhvri ületäitumine DCE/RPC kontroll mootoris Cisco ASA 5500 seeria ja Cisco Catalyst 6500 seeria seadmetel CVE
Tartu Ülikool Matemaatika-informaatikateaduskond Arvutiteaduse instituut Pinu põhine puhvri ületäitumine DCE/RPC kontroll mootoris Cisco ASA 5500 seeria ja Cisco Catalyst 6500 seeria seadmetel CVE-2012-4661
More informationD2D Coupon Dissemination
UNIVERSITY OF TARTU Institute of Computer Science Computer Science Curriculum Henri Ots D2D Coupon Dissemination Bachelor s Thesis (9 ECTS) Supervisor: Huber Flores, PhD Tartu 2016 D2D Coupon Dissemination
More informationProvably Correct Software
Provably Correct Software Max Schäfer Institute of Information Science/Academia Sinica September 17, 2007 1 / 48 The Need for Provably Correct Software BUT bugs are annoying, embarrassing, and cost gazillions
More informationTypes, Type Inference and Unification
Types, Type Inference and Unification Mooly Sagiv Slides by Kathleen Fisher and John Mitchell Cornell CS 6110 Summary (Functional Programming) Lambda Calculus Basic ML Advanced ML: Modules, References,
More informationInformatics 1 Functional Programming Lecture 7. Map, filter, fold. Don Sannella University of Edinburgh
Informatics 1 Functional Programming Lecture 7 Map, filter, fold Don Sannella University of Edinburgh Part I Map Squares *Main> squares [1,-2,3] [1,4,9] squares :: [Int] -> [Int] squares xs [ x*x x
More information1 The smallest free number
1 The smallest free number Introduction Consider the problem of computing the smallest natural number not in a given finite set X of natural numbers. The problem is a simplification of a common programming
More informationcs242 Kathleen Fisher Reading: Concepts in Programming Languages, Chapter 6 Thanks to John Mitchell for some of these slides.
cs242 Kathleen Fisher Reading: Concepts in Programming Languages, Chapter 6 Thanks to John Mitchell for some of these slides. We are looking for homework graders. If you are interested, send mail to cs242cs.stanford.edu
More informationLühike paigaldusjuhend TK-V201S TK-V401S 1.01
Lühike paigaldusjuhend TK-V201S TK-V401S 1.01 Sisukord Eesti 1 1. Enne alustamist 1 2. Riistvara paigaldamine 2 Technical Specifications 8 Tõrkeotsing 9 Version 05.12.2010 1. Enne alustamist Eesti Pakendi
More informationG Programming Languages Spring 2010 Lecture 6. Robert Grimm, New York University
G22.2110-001 Programming Languages Spring 2010 Lecture 6 Robert Grimm, New York University 1 Review Last week Function Languages Lambda Calculus SCHEME review 2 Outline Promises, promises, promises Types,
More informationScripted Components: Problem. Scripted Components. Problems with Components. Single-Language Assumption. Dr. James A. Bednar
Scripted Components: Problem Scripted Components Dr. James A. Bednar jbednar@inf.ed.ac.uk http://homepages.inf.ed.ac.uk/jbednar (Cf. Reuse-Oriented Development; Sommerville 2004 Chapter 4, 18) A longstanding
More informationScripted Components Dr. James A. Bednar
Scripted Components Dr. James A. Bednar jbednar@inf.ed.ac.uk http://homepages.inf.ed.ac.uk/jbednar SAPM Spring 2012: Scripted Components 1 Scripted Components: Problem (Cf. Reuse-Oriented Development;
More informationProgramming with Math and Logic
.. Programming with Math and Logic an invitation to functional programming Ed Morehouse Wesleyan University The Plan why fp? terms types interfaces The What and Why of Functional Programming Computing
More informationUNIT I Programming Language Syntax and semantics. Kainjan Sanghavi
UNIT I Programming Language Syntax and semantics B y Kainjan Sanghavi Contents Bird s eye view of programming language concepts Syntax Semantics Pragmatics Programming Language Concepts A programming language
More informationC07: Testing and JUnit
CISC 3120 C07: Testing and JUnit Hui Chen Department of Computer & Information Science CUNY Brooklyn College 9/19/2017 CUNY Brooklyn College 1 Outline Recap and issues Grades and feedback Assignments &
More informationHaskell Types, Classes, and Functions, Currying, and Polymorphism
1 CSCE 314: Programming Languages Dr. Flemming Andersen Haskell Types, Classes, and Functions, Currying, and Polymorphism 2 Types A type is a collection of related values. For example, Bool contains the
More informationCSCI.4430/6969 Programming Languages Lecture Notes
CSCI.4430/6969 Programming Languages Lecture Notes August 28, 2006 1 Brief History of Programming Languages Ada Augusta, the Countess of Lovelace, the daughter of the poet Lord Byron, is attributed as
More informationCS 345. Functions. Vitaly Shmatikov. slide 1
CS 345 Functions Vitaly Shmatikov slide 1 Reading Assignment Mitchell, Chapter 7 C Reference Manual, Chapters 4 and 9 slide 2 Procedural Abstraction Can be overloaded (e.g., binary +) Procedure is a named
More informationHow does ML deal with +?
How does ML deal with +? Moscow ML version 2.00 (June 2000) - op +; > val it = fn : int * int -> int - 1 + 1; > val it = 2 : int - 1.0 + 1.0; > val it = 2.0 : real - false + false;! Overloaded + cannot
More informationDoes the Shannon bound really apply to all data structures?
Proceedings of the Estonian Academy of Sciences, 2013, 62, 1, 47 58 doi: 10.3176/proc.2013.1.06 Available online at www.eap.ee/proceedings Does the Shannon bound really apply to all data structures? Antti
More informationLecture 4 Memory Management
Lecture 4 Memory Management Dr. Wilson Rivera ICOM 4036: Programming Languages Electrical and Computer Engineering Department University of Puerto Rico Some slides adapted from Sebesta s textbook Lecture
More informationOutline. Introduction to Programming (in C++) Introduction. First program in C++ Programming examples
Outline Introduction to Programming (in C++) Introduction Programming examples Algorithms, programming languages and computer programs Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. of Computer
More informationCS A331 Programming Language Concepts
CS A331 Programming Language Concepts Lecture 4 Programming Language Semantics and Code Generation February 3, 2014 Sam Siewert PLP Companion Materials CD-ROM is On-Line: http://booksite.elsevier.com/9780123745149/?isbn=978
More informationMore Examples. Lecture 24: More Scala. Higher-Order Functions. Control Structures
More Examples Lecture 24: More Scala CSC 131 Fall, 2014 Kim Bruce MyList, MyArrayList, SinglyLinkedList - Val vs var - Can create Array[T] (unlike Java), though need implicit ClassManifest - foreach(f)
More informationConcepts Introduced in Chapter 7
Concepts Introduced in Chapter 7 Storage Allocation Strategies Static Stack Heap Activation Records Access to Nonlocal Names Access links followed by Fig. 7.1 EECS 665 Compiler Construction 1 Activation
More informationSimon Peyton Jones Microsoft Research August 2013
Simon Peyton Jones Microsoft Research August 2013 reverse :: a. [a] -> [a] xs :: [Bool] foo :: [Bool] foo = reverse xs Instantiate reverse with a unification variable, standing for an as-yet-unknown type.
More informationPrograms are: CMPSCI 105/119/120: Programming, Flowchar<ng, and Running Program Flowcharts
Programs are: CMPSCI 105/119/120: Programming, Flowchar
More informationCOSC Software Engineering. Lecture 23: Multilingual and Component Programming
COSC345 2013 Software Engineering Lecture 23: Multilingual and Component Programming Isolation Scale Change Errors These are core issues in Software Engineering Isolation is our main way to deal with them
More informationExpressions and Assignment
Expressions and Assignment COS 301: Programming Languages Outline Other assignment mechanisms Introduction Expressions: fundamental means of specifying computations Imperative languages: usually RHS of
More informationLogic Programming II & Revision
Logic Programming II & Revision Gerardo Schneider Department of Informatics University of Oslo 1 Some corrections (1) hsiblings(x,y) :- child(x,parent), child(y,parent), X \== Y, child(x,parent1), child(y,parent2),
More informationIntroduction to Scientific Computing Languages
1 / 1 Introduction to Scientific Computing Languages Prof. Paolo Bientinesi pauldj@aices.rwth-aachen.de Languages for Scientific Computing 2 / 1 What is a programming language? Languages for Scientific
More informationPädevushaldus RESTful veebiteenuste abil
Tallinna Ülikool Informaatika Instituut Pädevushaldus RESTful veebiteenuste abil Seminaritöö Autor: Eigen Lenk Juhendaja: Mart Laanpere Tallinn 2010 Sisukord Sissejuhatus... 3 1. Muutused veebitarkvara
More informationCSE341, Spring 2013, Final Examination June 13, 2013
CSE341, Spring 2013, Final Examination June 13, 2013 Please do not turn the page until 8:30. Rules: The exam is closed-book, closed-note, except for both sides of one 8.5x11in piece of paper. Please stop
More informationLECTURE 1. Overview and History
LECTURE 1 Overview and History COURSE OBJECTIVE Our ultimate objective in this course is to provide you with the knowledge and skills necessary to create a new programming language (at least theoretically).
More information