SlideShare ist ein Scribd-Unternehmen logo
1 von 12
THE IOT ACADEMY.
Imperative Programming
This architecture is also reflected in most modern
programming languages such as Java, C, C++, C#,
Python, or Matlab.
Their programs consist of sequences of instructions,
each of which changes the system’s state, such as the
values of variables or other memory content.
Such languages are called imperative languages.
Object-oriented programming provides mechanisms
for encapsulation of functional program and data units
but is still based on the imperative paradigm.
Lambda (ïŹ) Calculus
Roughly at the same time when Turing developed his Turing
machine, Alonzo Church devised a different paradigm of
computation, called lambda calculus.
It is based on anonymous functions described by lambda
expressions.
By mechanisms such as composition and recursion,
lambda expressions can represent complex computations.
It can be shown that Turing machines and lambda calculus
have identical computational power, which is believed to be
universal (Church-Turing thesis, 1937).
Lambda (ïŹ) Calculus
Lambda calculus provides a more abstract, mathematical
description of an algorithm.
Such descriptions are typically more concise and elegant
than those provided by Turing machines.
On the other hand, Turing-machine style computation can
be directly translated into hardware, which is much more
difficult for lambda calculus.
Nevertheless, there are programming languages that are
based on lambda calculus, and they are referred to as
functional languages.
Functional Programming
The most striking feature of purely functional programming
is that there is no state.
This means that our variables are not variable, i.e.,
cannot change their values!
In other words, they are immutable and only represent
some constant value.
The execution of a program only involves the evaluation of
functions.
This sounds weird – what are the advantages and
disadvantages of functional programming?
Functional Programming
The advantage of having no state is that functions have
no side effects.
Therefore, we can be sure that whenever we evaluate a
function with the same inputs, we will get the same
output, and nothing in our system changed due to this
evaluation.
This prevents most of the bugs that commonly occur in
imperative programming.
You will learn about other advantages during the next
few lectures

Functional Programming
The main problem with strictly preventing side effects is that
user input and output during program execution become
impossible.
To enable such user interaction, we have to sometimes allow
state changes. It is then important to separate such “impure”
code from the rest of the program.
There are many functional languages, with some being as old
as the earliest imperative ones.
Examples are: LISP, Scheme, Haskell, Erlang, R, Clojure,
Scala, OCaml, and F#.
Functional Programming
Functional programming is not the best solution to every
problem, just like object-oriented programming is not, either.
In the context of symbolic AI, you will see how functional
programming allows you to write very concise, readable, and
reusable code.
Even if you rarely or never use it again afterwards, it will give
you a different perspective on programming and may change
the way you program.
Haskell and Frege
In this course, we will use Haskell, because its purity forces
you to use functional programming principles.
Specifically, we will use its dialect Frege, which generates code
for the Java Virtual Machine.
This way your programs can interact with Java programs,
especially the Isola game interface for our tournament.
Frege Resources
Free Haskell tutorials:
http://learnyouahaskell.com/
http://book.realworldhaskell.org/
Differences between Haskell and Frege:
https://github.com/Frege/frege/wiki/Differences-between-
Frege-and-Haskell
I recommend that you read Chapters 1 and 2 of “Learn you a
Haskell” and experiment with the language a bit.
Frege Resources
You can play around with Frege online:
http://try.frege-lang.org/
Get the Frege compiler here:
https://github.com/Frege/frege
Here is a Frege plugin for Eclipse:
https://github.com/Frege/eclipse-plugin
You should definitely look at the plugin tutorial:
https://github.com/Frege/eclipse-plugin/wiki/fregIDE-
Tutorial
The IoT Academy training part2 AI Architecture

Weitere Àhnliche Inhalte

Was ist angesagt?

Programming Paradigms Seminar 1
Programming Paradigms Seminar 1Programming Paradigms Seminar 1
Programming Paradigms Seminar 1
neoxiuting
 
Cble assignment powerpoint activity for moodle 1
Cble assignment powerpoint activity for moodle 1Cble assignment powerpoint activity for moodle 1
Cble assignment powerpoint activity for moodle 1
LK394
 
C++ ppt
C++ pptC++ ppt
C++ ppt
parpan34
 
Net framework
Net frameworkNet framework
Net framework
Tuan Ngo
 

Was ist angesagt? (20)

Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming Paradigms
 
Write programs to solve problems pascal programming
Write programs to solve problems   pascal programmingWrite programs to solve problems   pascal programming
Write programs to solve problems pascal programming
 
Programming paradigm
Programming paradigmProgramming paradigm
Programming paradigm
 
Programming Paradigms Seminar 1
Programming Paradigms Seminar 1Programming Paradigms Seminar 1
Programming Paradigms Seminar 1
 
Programming Methodology
Programming MethodologyProgramming Methodology
Programming Methodology
 
Imperative and-functional-programming
Imperative and-functional-programmingImperative and-functional-programming
Imperative and-functional-programming
 
Introduction to Procedural Programming in C++
Introduction to Procedural Programming in C++Introduction to Procedural Programming in C++
Introduction to Procedural Programming in C++
 
Code: from Procedural to Object Oriented
Code: from Procedural to Object OrientedCode: from Procedural to Object Oriented
Code: from Procedural to Object Oriented
 
Cble assignment powerpoint activity for moodle 1
Cble assignment powerpoint activity for moodle 1Cble assignment powerpoint activity for moodle 1
Cble assignment powerpoint activity for moodle 1
 
JDT Embraces Lambda Expressions - EclipseCon North America 2014
JDT Embraces Lambda Expressions - EclipseCon North America 2014JDT Embraces Lambda Expressions - EclipseCon North America 2014
JDT Embraces Lambda Expressions - EclipseCon North America 2014
 
Tech for devs, F#
Tech for devs, F#Tech for devs, F#
Tech for devs, F#
 
Programming in c++ ppt
Programming in c++ pptProgramming in c++ ppt
Programming in c++ ppt
 
An Efficient and Parallel Abstract Interpreter in Scala — Presentation
An Efficient and Parallel Abstract Interpreter in Scala — PresentationAn Efficient and Parallel Abstract Interpreter in Scala — Presentation
An Efficient and Parallel Abstract Interpreter in Scala — Presentation
 
Types of Programming Errors
Types of Programming ErrorsTypes of Programming Errors
Types of Programming Errors
 
C++ ppt
C++ pptC++ ppt
C++ ppt
 
Overview of programming paradigms
Overview of programming paradigmsOverview of programming paradigms
Overview of programming paradigms
 
Apple’s New Swift Programming Language Takes Flight With New Enhancements And...
Apple’s New Swift Programming Language Takes Flight With New Enhancements And...Apple’s New Swift Programming Language Takes Flight With New Enhancements And...
Apple’s New Swift Programming Language Takes Flight With New Enhancements And...
 
Net framework
Net frameworkNet framework
Net framework
 
Fun with lambda expressions
Fun with lambda expressionsFun with lambda expressions
Fun with lambda expressions
 
Bnf and ambiquity
Bnf and ambiquityBnf and ambiquity
Bnf and ambiquity
 

Ähnlich wie The IoT Academy training part2 AI Architecture

4 coding from algorithms
4 coding from algorithms4 coding from algorithms
4 coding from algorithms
hccit
 
Programming
ProgrammingProgramming
Programming
vanesa4ab
 
379008-rc217-functionalprogramming
379008-rc217-functionalprogramming379008-rc217-functionalprogramming
379008-rc217-functionalprogramming
Luis Atencio
 
Training 8051Report
Training 8051ReportTraining 8051Report
Training 8051Report
Kuldeep Kaushik
 

Ähnlich wie The IoT Academy training part2 AI Architecture (20)

4 coding from algorithms
4 coding from algorithms4 coding from algorithms
4 coding from algorithms
 
Programming
ProgrammingProgramming
Programming
 
379008-rc217-functionalprogramming
379008-rc217-functionalprogramming379008-rc217-functionalprogramming
379008-rc217-functionalprogramming
 
About Functional Programming
About Functional ProgrammingAbout Functional Programming
About Functional Programming
 
Doppl Development Introduction
Doppl Development IntroductionDoppl Development Introduction
Doppl Development Introduction
 
Training 8051Report
Training 8051ReportTraining 8051Report
Training 8051Report
 
Ic lecture8
Ic lecture8 Ic lecture8
Ic lecture8
 
Programming languages and paradigms
Programming languages and paradigmsProgramming languages and paradigms
Programming languages and paradigms
 
Functional programming in TypeScript
Functional programming in TypeScriptFunctional programming in TypeScript
Functional programming in TypeScript
 
Seeking Clojure
Seeking ClojureSeeking Clojure
Seeking Clojure
 
Programing paradigm & implementation
Programing paradigm & implementationPrograming paradigm & implementation
Programing paradigm & implementation
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & Languages
 
Java 8-revealed
Java 8-revealedJava 8-revealed
Java 8-revealed
 
Why functional programming in C# & F#
Why functional programming in C# & F#Why functional programming in C# & F#
Why functional programming in C# & F#
 
Survelaine murillo ppt
Survelaine murillo pptSurvelaine murillo ppt
Survelaine murillo ppt
 
PARADIGM IT.pptx
PARADIGM IT.pptxPARADIGM IT.pptx
PARADIGM IT.pptx
 
Unit 1
Unit 1Unit 1
Unit 1
 
JAVA
JAVAJAVA
JAVA
 
SYSTEM DEVELOPMENT
SYSTEM DEVELOPMENTSYSTEM DEVELOPMENT
SYSTEM DEVELOPMENT
 
Introduction to Clojure
Introduction to ClojureIntroduction to Clojure
Introduction to Clojure
 

Mehr von The IOT Academy

Mehr von The IOT Academy (20)

Embedded Systems Programming
Embedded Systems ProgrammingEmbedded Systems Programming
Embedded Systems Programming
 
Introduction to Digital Marketing Certification Course.pdf
Introduction to Digital Marketing Certification Course.pdfIntroduction to Digital Marketing Certification Course.pdf
Introduction to Digital Marketing Certification Course.pdf
 
Google SEO 2023: Complete SEO Guide
Google SEO 2023: Complete SEO GuideGoogle SEO 2023: Complete SEO Guide
Google SEO 2023: Complete SEO Guide
 
Embedded C The IoT Academy
Embedded C The IoT AcademyEmbedded C The IoT Academy
Embedded C The IoT Academy
 
Basics of c++ Programming Language
Basics of c++ Programming LanguageBasics of c++ Programming Language
Basics of c++ Programming Language
 
MachineLlearning introduction
MachineLlearning introductionMachineLlearning introduction
MachineLlearning introduction
 
IoT Node-Red Presentation
IoT  Node-Red PresentationIoT  Node-Red Presentation
IoT Node-Red Presentation
 
IoT Introduction Architecture and Applications
IoT Introduction Architecture and ApplicationsIoT Introduction Architecture and Applications
IoT Introduction Architecture and Applications
 
UCT IoT Deployment and Challenges
UCT IoT Deployment and ChallengesUCT IoT Deployment and Challenges
UCT IoT Deployment and Challenges
 
UCT Electrical Vehicle Infrastructure
UCT Electrical Vehicle InfrastructureUCT Electrical Vehicle Infrastructure
UCT Electrical Vehicle Infrastructure
 
Uct 5G Autonomous Cars
Uct 5G Autonomous CarsUct 5G Autonomous Cars
Uct 5G Autonomous Cars
 
Fdp uct industry4.0_talk
Fdp uct industry4.0_talkFdp uct industry4.0_talk
Fdp uct industry4.0_talk
 
Success ladder to the Corporate world
Success ladder to the Corporate worldSuccess ladder to the Corporate world
Success ladder to the Corporate world
 
The iot academy_lpwan_lora
The iot academy_lpwan_loraThe iot academy_lpwan_lora
The iot academy_lpwan_lora
 
The iot academy_embeddedsystems_training_circuitdesignpart3
The iot academy_embeddedsystems_training_circuitdesignpart3The iot academy_embeddedsystems_training_circuitdesignpart3
The iot academy_embeddedsystems_training_circuitdesignpart3
 
The iot academy_embeddedsystems_training_basicselectronicspart2
The iot academy_embeddedsystems_training_basicselectronicspart2The iot academy_embeddedsystems_training_basicselectronicspart2
The iot academy_embeddedsystems_training_basicselectronicspart2
 
The iot academy_embeddedsystems_training_basicelectronicspart1
The iot academy_embeddedsystems_training_basicelectronicspart1The iot academy_embeddedsystems_training_basicelectronicspart1
The iot academy_embeddedsystems_training_basicelectronicspart1
 
The iot academy_lpwan
The iot academy_lpwanThe iot academy_lpwan
The iot academy_lpwan
 
The iotacademy industry4.0_talk_slideshare
The iotacademy industry4.0_talk_slideshareThe iotacademy industry4.0_talk_slideshare
The iotacademy industry4.0_talk_slideshare
 
The iot acdemy_awstraining_part4_aws_lab
The iot acdemy_awstraining_part4_aws_labThe iot acdemy_awstraining_part4_aws_lab
The iot acdemy_awstraining_part4_aws_lab
 

KĂŒrzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

KĂŒrzlich hochgeladen (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

The IoT Academy training part2 AI Architecture

  • 2. Imperative Programming This architecture is also reflected in most modern programming languages such as Java, C, C++, C#, Python, or Matlab. Their programs consist of sequences of instructions, each of which changes the system’s state, such as the values of variables or other memory content. Such languages are called imperative languages. Object-oriented programming provides mechanisms for encapsulation of functional program and data units but is still based on the imperative paradigm.
  • 3. Lambda (ïŹ) Calculus Roughly at the same time when Turing developed his Turing machine, Alonzo Church devised a different paradigm of computation, called lambda calculus. It is based on anonymous functions described by lambda expressions. By mechanisms such as composition and recursion, lambda expressions can represent complex computations. It can be shown that Turing machines and lambda calculus have identical computational power, which is believed to be universal (Church-Turing thesis, 1937).
  • 4. Lambda (ïŹ) Calculus Lambda calculus provides a more abstract, mathematical description of an algorithm. Such descriptions are typically more concise and elegant than those provided by Turing machines. On the other hand, Turing-machine style computation can be directly translated into hardware, which is much more difficult for lambda calculus. Nevertheless, there are programming languages that are based on lambda calculus, and they are referred to as functional languages.
  • 5. Functional Programming The most striking feature of purely functional programming is that there is no state. This means that our variables are not variable, i.e., cannot change their values! In other words, they are immutable and only represent some constant value. The execution of a program only involves the evaluation of functions. This sounds weird – what are the advantages and disadvantages of functional programming?
  • 6. Functional Programming The advantage of having no state is that functions have no side effects. Therefore, we can be sure that whenever we evaluate a function with the same inputs, we will get the same output, and nothing in our system changed due to this evaluation. This prevents most of the bugs that commonly occur in imperative programming. You will learn about other advantages during the next few lectures

  • 7. Functional Programming The main problem with strictly preventing side effects is that user input and output during program execution become impossible. To enable such user interaction, we have to sometimes allow state changes. It is then important to separate such “impure” code from the rest of the program. There are many functional languages, with some being as old as the earliest imperative ones. Examples are: LISP, Scheme, Haskell, Erlang, R, Clojure, Scala, OCaml, and F#.
  • 8. Functional Programming Functional programming is not the best solution to every problem, just like object-oriented programming is not, either. In the context of symbolic AI, you will see how functional programming allows you to write very concise, readable, and reusable code. Even if you rarely or never use it again afterwards, it will give you a different perspective on programming and may change the way you program.
  • 9. Haskell and Frege In this course, we will use Haskell, because its purity forces you to use functional programming principles. Specifically, we will use its dialect Frege, which generates code for the Java Virtual Machine. This way your programs can interact with Java programs, especially the Isola game interface for our tournament.
  • 10. Frege Resources Free Haskell tutorials: http://learnyouahaskell.com/ http://book.realworldhaskell.org/ Differences between Haskell and Frege: https://github.com/Frege/frege/wiki/Differences-between- Frege-and-Haskell I recommend that you read Chapters 1 and 2 of “Learn you a Haskell” and experiment with the language a bit.
  • 11. Frege Resources You can play around with Frege online: http://try.frege-lang.org/ Get the Frege compiler here: https://github.com/Frege/frege Here is a Frege plugin for Eclipse: https://github.com/Frege/eclipse-plugin You should definitely look at the plugin tutorial: https://github.com/Frege/eclipse-plugin/wiki/fregIDE- Tutorial

Hinweis der Redaktion

  1. 1