Lecture 4 Functional Programming Paradigms - Operational Semantics
Lecture 4 Functional Programming Paradigms - Operational Semantics
• If k then
• Both of which can be represented in the following form:
Value Rule examples:
OPERATIONAL SEMANTICS FOR BOOLEAN VALUES
IN THE FUNCTIONAL PROGRAMMING PARADIGM
NOT Rule examples:
OPERATIONAL SEMANTICS FOR BOOLEAN VALUES
IN THE FUNCTIONAL PROGRAMMING PARADIGM
AND Rule example:
True and True():
OPERATIONAL SEMANTICS FOR BOOLEAN VALUES
IN THE FUNCTIONAL PROGRAMMING PARADIGM
• 3. OR Rule:
OR Rule example:
True OR False ():
OPERATION SEMANTICS FOR
FUNCTIONS IN THE FUNCTIONAL
PROGRAMMING PARADIGM
• The basis of functional programming is lambda calculus. Two
languages that are ideal for functional programming are Haskell and
Python. You can create lambda functions in Haskell. You can create
specially defined operators. The following code creates a new
operator, +=: For example
• (+=) = \x y -> x + y
• To test this code, you type 1+=2 and press Enter. The output is 3, as
you might expect.
Syntax Of Lambda Calculus
• Let be
• be
• be