Урок 6. Чистое лямбда-исчисление. Система дистанционного обучения MyDLSУрок 6. Чистое лямбда-исчисление. Больше интересных публикаций смотри на сайте mydls.ru
Урок 4. "Завязывание узлов". КлассыСистема дистанционного обучения MyDLSУрок 3. "Завязывание узлов". Классы. Больше интересных публикаций смотри на сайте mydls.ru
Discovering Lambdas in Java 8Stfalcon MeetupsOlexandra Dmytrenko
QA Automating at EPAM Systems
I'll show you how to switch from writing standard code using good old Java7 into writing it using functional way presented in Java8. The training is counted on beginners in the subject who like discovering the new horizons or for those who want to become more firm in using the new lambda features.
Урок 1. Что такое функциональное программированиеСистема дистанционного обучения MyDLSУрок 1. Что такое функциональное программирование. Больше интересных публикаций смотри на сайте mydls.ru
Алгоритмы решения задачи о булевой выполнимости (SAT) и их применение в крипт...Positive Hack DaysАлгоритмы решения задачи о
булевой выполнимости (SAT)
и их применение в
криптоанализе
Урок 7. Интерпретация и компиляция функциональных программ.Система дистанционного обучения MyDLSУрок 7. Интерпретация и компиляция функциональных программ. Больше интересных публикаций смотри на сайте mydls.ru
особенности программирования на с++mcroitorочень кратко о возможностях языка с++, которые необходимо знать перед изучением устройства стандартной библиотеки с++
Математическое обоснование S.O.L.I.D принциповetyumentcevДается математическое обоснование S.O.L.I.D принципов с помощью логики Хоара, из которого следует, что S.O.L.I.D верны не только для ООП, но и для статического полиморфизма, но и для императивного программирования вообще.
Java8. InnovationsNakraynikov OlegЛекция для студентов АлтГТУ, проведенная 04.03.2015. В ходе лекции рассматривались следующие ключевые моменты:
1) Lambda project
2) Steam API
3) Date API
Урок 3. Карринг и ленивые вычисления.Система дистанционного обучения MyDLSУрок 3. Карринг и ленивые вычисления. Больше интересных публикаций смотри на сайте mydls.ru
Fifty Years of Global LNG, Trafigura White PaperTrafiguraLNG has experienced remarkable developments in commercialization and export capacity in a span of just 50 years. In this paper produced for the 2014 LNG Asia Pacific Summit in Singapore, Professor Craig Pirrong probes where the industry is headed as oil-based pricing becomes a relic of the past. His analysis and insights describe a potential revolution in LNG pricing and contracting mechanisms that will rely on trading firms and commodity markets to secure supply and manage risk.
The white paper is written by Craig Pirrong, professor of finance and the Energy Markets Director for the Global Energy Management Institute at the Bauer College of Business at the University of Houston. The white paper was written with the funding and support of The Trafigura Group.
(Trafigura, September 2014)
Read more about Trafigura on our website: www.trafigura.com
Урок 1. Что такое функциональное программированиеСистема дистанционного обучения MyDLSУрок 1. Что такое функциональное программирование. Больше интересных публикаций смотри на сайте mydls.ru
Алгоритмы решения задачи о булевой выполнимости (SAT) и их применение в крипт...Positive Hack DaysАлгоритмы решения задачи о
булевой выполнимости (SAT)
и их применение в
криптоанализе
Урок 7. Интерпретация и компиляция функциональных программ.Система дистанционного обучения MyDLSУрок 7. Интерпретация и компиляция функциональных программ. Больше интересных публикаций смотри на сайте mydls.ru
особенности программирования на с++mcroitorочень кратко о возможностях языка с++, которые необходимо знать перед изучением устройства стандартной библиотеки с++
Математическое обоснование S.O.L.I.D принциповetyumentcevДается математическое обоснование S.O.L.I.D принципов с помощью логики Хоара, из которого следует, что S.O.L.I.D верны не только для ООП, но и для статического полиморфизма, но и для императивного программирования вообще.
Java8. InnovationsNakraynikov OlegЛекция для студентов АлтГТУ, проведенная 04.03.2015. В ходе лекции рассматривались следующие ключевые моменты:
1) Lambda project
2) Steam API
3) Date API
Урок 3. Карринг и ленивые вычисления.Система дистанционного обучения MyDLSУрок 3. Карринг и ленивые вычисления. Больше интересных публикаций смотри на сайте mydls.ru
Fifty Years of Global LNG, Trafigura White PaperTrafiguraLNG has experienced remarkable developments in commercialization and export capacity in a span of just 50 years. In this paper produced for the 2014 LNG Asia Pacific Summit in Singapore, Professor Craig Pirrong probes where the industry is headed as oil-based pricing becomes a relic of the past. His analysis and insights describe a potential revolution in LNG pricing and contracting mechanisms that will rely on trading firms and commodity markets to secure supply and manage risk.
The white paper is written by Craig Pirrong, professor of finance and the Energy Markets Director for the Global Energy Management Institute at the Bauer College of Business at the University of Houston. The white paper was written with the funding and support of The Trafigura Group.
(Trafigura, September 2014)
Read more about Trafigura on our website: www.trafigura.com
World wonders - Learning new wordsYazeedLankaA colorful lesson on World Wonders for students to learn some new words by guessing the meaning of the pictures. These slides were used by me at Holmesglen Institute for my CELTA course.
Функциональное программирование.Списки. Функции высших порядковСистема дистанционного обучения MyDLSУрок 2. Списки. Функции высших порядков. Больше интересных публикаций смотри на сайте mydls.ru
Foundations for Growth: Infrastructure Investment in Emerging MarketsTrafiguraThis white paper looks at how investment in infrastructure is of vital importance for the global economy, and in particular for developing nations.
Equally, if a widening emerging-economy ‘infrastructure gap’ is to be adequately bridged, there is a requirement for much greater involvement of the private sector in the design and delivery of these assets. With government finances increasingly constrained, and the various competing claims on them are only likely to multiply, tapping the financial resources and broader experience and expertise of private investors and producers is a major priority.
Trafigura has long demonstrated competence in trading and transportation of commodities, and is also aware of global citizenship responsibilities that go some way beyond those owed to its immediate shareholders. It stands to be at the leading edge of the future expansion of global infrastructure which supports trade.
It is our hope that this white paper will contribute to an informed debate about the important role of infrastructure in fostering development, and will encourage the search for innovative public-private partnerships in this area. Since the emerging-market growth that is fuelling demand is unlikely to abate in the foreseeable future, solutions will be at a premium in coming years.
(Trafigura, March 2015)
About the authors
Russell Jones, Partner, Llewellyn Consulting - Russell Jones has been a macroeconomist in the financial markets for almost three decades, occupying senior roles in London, Tokyo, the Middle East, and Sydney, and working on both the ‘buy’ and ‘sell’ sides. (...)
Camille Viros, Senior Economist, Llewellyn Consulting - Prior to rejoining Llewellyn Consulting Camille worked for Barclays Wealth, where her main focus was the euro area, producing analysis and forecasts of the region’s main economic, policy and market developments. Before that, she worked as a policy economist at Lehman Brothers, covering a wide range of subjects, including climate change, population ageing, global macroeconomic issues and the financial crisis. (...)
Watch the videos where Russell Jones discusses his white paper.
http://www.trafigura.com/research/foundations-for-growth-infrastructure-investment-in-emerging-markets/
The Economics of Commodity Trading Firms - White PaperTrafiguraCommodity trading is one of the oldest forms of human activity. It is central to the global economy. Yet up to now there has been remarkably little research into this important area. The Economics of Commodity Trading Firms demystifies the commodity trading business through a combination of description and analysis.
The white paper is written by Craig Pirrong, professor of finance and the Energy Markets Director for the Global Energy Management Institute at the Bauer College of Business at the University of Houston. His research focuses on the economics of commodity markets. Business commentator and broadcaster Michael McKay recently interviewed the professor about the contents of his white paper.
About the author
Craig Pirrong is a professor of finance and the Energy Markets Director for the Global Energy Management Institute at the Bauer College of Business at the University of Houston. His research focuses on the economics of commodity markets. He has published over thirty articles in professional publications and is the author of four books. He has also consulted widely for clients including electric utilities, commodity traders, processors and consumers and commodity exchanges.
Watch the videos where the Professor Pirrong discusses his white paper.
http://www.trafigura.com/research/the-economics-of-commodity-trading-firms/
Not Too Big To Fail – Systemic Risk, Regulation, and the Economics of Commodi...TrafiguraIn the aftermath of the Great Financial Crisis, regulatory authorities have undertaken a searching review of firms throughout the financial markets to identify those that could pose systemic risks. This review has extended to include firms not typically thought of as part of the financial sector, even broadly construed such as Commodity Trading Firms (CTFs).
Some regulators have questioned whether some of these firms are “too big to fail,” and hence pose a threat to the stability of the financial system, necessitating subjecting them to additional regulation akin to that imposed on banks.
This white paper explains the functions of these firms and evaluates whether they pose systemic risks that would justify subjecting them to regulations (notably capital requirements) similar to those imposed on other entities such as banks which are deemed to be systemically important.
About the author
Craig Pirrong is a professor of finance and the Energy Markets Director for the Global Energy Management Institute at the Bauer College of Business at the University of Houston. His research focuses on the economics of commodity markets. He has published over thirty articles in professional publications and is the author of four books. He has also consulted widely for clients including electric utilities, commodity traders, processors and consumers and commodity exchanges
(Trafigura, March 2015)
Watch the video: Professor Pirrong discusses white paper: “Not Too Big To Fail – Systemic Risk, Regulation, and the Economics of Commodity Trading Firms”
http://www.trafigura.com/research/not-too-big-to-fail-systemic-risk-regulation-and-the-economics-of-commodity-trading-firms/
The economics of commodity trading firms in english (abridged)TrafiguraCommodity trading is one of the oldest forms of human activity. It is central to the global economy. Yet up to now there has been remarkably little research into this important area. The Economics of Commodity Trading Firms demystifies the commodity trading business through a combination of description and analysis.
The white paper is written by Craig Pirrong, professor of finance and the Energy Markets Director for the Global Energy Management Institute at the Bauer College of Business at the University of Houston. His research focuses on the economics of commodity markets. Business commentator and broadcaster Michael McKay recently interviewed the professor about the contents of his white paper.
Trafigura 2015 Interim ReportTrafiguraThe interim report summarizes Trafigura Beheer B.V.'s financial and business performance for the six-month period ended 31 March 2015. Key highlights include:
- Group revenue was $48.2 billion, down from $63.8 billion the previous year due to lower commodity prices. However, gross profit rose 58% to $1,516.9 million due to volume increases.
- Net profit was a record $653.8 million, up 39% over the same period last year.
- The Oil and Petroleum Products division performed strongly, with gross profit up 77% to $1,008 million on increased volumes and margins.
- The Metals and Minerals
Trafigura 2013 Full Annual ReportTrafiguraTrafigura 2013 Full Annual Report
Trafigura’s financial year runs from 1 October, 2012 to 30 September, 2013.
Урок 9. Комбинаторная редукцияСистема дистанционного обучения MyDLSУрок 9. Комбинаторная редукция. Больше интересных публикаций смотри на сайте mydls.ru
2015 Trafigura Responsibility Report TrafiguraTrafigura is one of the world’s leading commodity trading firms. We are leveraging our experience and expertise to develop a more responsible business.
We have set ourselves an important ambition: to become acknowledged sector leaders in the way we manage corporate responsibility. This commitment is endorsed by Trafigura’s Management Board and shareholders – all closely involved in running the business - and by employees across the Group. It is also firmly rooted in commercial logic, for a number of reasons.
2-Epidemiological studiesResearchGuruThe document discusses different types of epidemiological studies, including descriptive studies like case reports and case series that focus on person, place and time to create hypotheses. Analytical studies like case-control and cohort studies are used to test hypotheses by being either observational or interventional. Randomized controlled trials are the gold standard for comparing new interventions. Observational analytical studies include cross-sectional, cohort and case-control designs, while interventional analytical studies are clinical trials. The appropriate study design depends on the research goals and objectives.
Trafigura 2014 Interim ReportTrafiguraTrafigura's financial results for the first half of 2014 show:
- Group turnover of $63.8 billion, up 3% from the previous year.
- Gross profit of $960.8 million, unchanged from the previous year.
- Net profit of $469.7 million, up 24% from the previous year.
- Oil and petroleum products volumes increased 7% and non-ferrous and bulk volumes increased 67% compared to the previous year.
- Investments in infrastructure assets like ports and terminals in Brazil, the US, Peru and Colombia are expected to drive future growth.
project pptParwinder SinghThe document provides a summary of an industrial training project at FIAT India Automobiles Limited. It discusses 3 projects aimed at improving productivity, quality, and safety. Project 1 focuses on improving safety by implementing proper use of personal protective equipment. Project 2 analyzes defects using a problem-solving tool to identify human errors as the root cause. Project 3 reduces non-value-added activities in the trimming assembly line by merging inspection stages, eliminating unnecessary movements, and balancing the line activities. The goals are to reduce bottlenecks and increase production throughput.
Интерпретирование языков с помощью Free-монадZheka KozlovПрименение Free-монад для интерпретирования языков. Видео с доклада: http://www.youtube.com/watch?v=1Xa3sXj5Xfg
Основы Python. ФункцииTheoretical mechanics departmentОсновы языка Питон: функции, элементы функционального программирования, списочные выражения, генераторы. Презентация к лекции курса "Технологии и языки программирования".
Николай Паламарчук "Functional Programming basics for PHP developers"FwdaysFunctional Programming becomes very popular nowadays. What is it? Is it a hype or panacea? Should you deal with it as a PHP programmer? Let's find out!
Tech Talks @NSU: Как приручить дракона: введение в LLVMTech Talks @NSUhttp://techtalks.nsu.ru
Видеозапись: http://www.youtube.com/watch?v=v7uBLSm6ft8
06 октября 2015. Как приручить дракона: введение в LLVM (Дмитрий Кашицын, HDsoft)
«В этом докладе мы кратко расскажем о таком звере, о котором много кто слышал, но немногие щупали. Что такое компилятор на самом деле? Чем LLVM отличается от других компиляторов? Как в LLVM происходит компиляция программы, как работают оптимизации? Наконец, какой путь проходит программа от разбора исходного текста до генерации исполняемого файла?
Лекция будет обзорной и не потребует от слушателей глубоких знаний теории компиляторов.»
Лекция прочитана в рамках проекта Tech Talks @NSU – серии открытых лекций о разработке ПО и карьере в IT, проводимых в Новосибирском государственном университете.
Подробности: http://techtalks.nsu.ru
Как приручить дракона: введение в LLVMTech Talks @NSU10 июня 2015. Дмитрий Кашицын (HDsoft) дает обзор LLVM.
http://techtalks.nsu.ru
Видеозапись: https://plus.google.com/events/ctes98f7uhf19t5jlvlbk24dan4
В этом докладе мы кратко расскажем о таком звере, как LLVM, о котором много кто слышал, но немногие щупали. Что такое компилятор на самом деле? Чем LLVM отличается от других компиляторов? Как в LLVM происходит компиляция программы, как работают оптимизации? Наконец, какой путь проходит программа от разбора исходного текста до генерации исполняемого файла?
Лекция будет обзорной и не потребует от слушателей глубоких знаний теории компиляторов.
Лекция прочитана в рамках проекта Tech Talks @NSU – серии открытых лекций о разработке ПО и карьере в IT, проводимых в Новосибирском государственном университете.
Подробности: http://techtalks.nsu.ru
Недостатки PythonPython MeetupВ докладе раскрыты слабые места Python, проблемы с GC, функциональным стилем, реализацией стандартных структур данных и интерпретатора CPython.
Автор: Кирилл Лашкевич
1. 1
Кубенский А.А. Функциональное программирование.
Глава 5. Системы исполнения функциональных программ.
Глава 5. Системы исполнения функциональных программ
5.3. Функциональные модели последовательных процессов
Рассмотрим простой язык императивного программирования без функций,
переходов и сложных структур данных.
Выражения:
Целые числа: 12 25 0
Простые переменные целого типа: x myInt
Унарные и бинарные операции с целыми результатами: (x+12) * (y-1)
Логические константы и выражения (но не переменные): not (x < 5)
Операторы:
Присваивание: x := x+1
Последовательное исполнение: begin s1; s2; ... end
Условный оператор: if b then s1 else s2
Пустой оператор: skip
Оператор цикла: while b do s
Программа начинает работу в состоянии, заданном совокупностью значений переменных
(например, заданных оператором ввода данных), а результат программы – конечное состояние
(например, выведенное в конце работы оператором вывода).
2. 2
Кубенский А.А. Функциональное программирование.
Глава 5. Системы исполнения функциональных программ.
Рассмотрим программу вычисления факториала.
Пример программы.
begin f := 1;
while n > 1 do begin
f := f * n;
n := n – 1
end
end
В начальном состоянии существенно только
значение переменной n; в конце работы результат
определяется значением переменной f.
Прежде всего, переведем программу в вид, удобный для обработки.
data Expression = { представление выражений }
data Operator = { представление операторов }
data Context = { представление контекста переменных }
Два способа обработки и исполнения программы:
Интерпретация: interpret :: Operator -> Context -> Context
Компиляция: compile :: Operator -> (Context -> Context)
На самом деле оба способа представлены одной и той же карринговой функцией!
3. 3
Кубенский А.А. Функциональное программирование.
Глава 5. Системы исполнения функциональных программ.
Представление выражений и программ.
data Expression = Integral Int | Logical Bool
| Variable String
| Unary String Expression
| Binary Expression String Expression
data Operator = Skip
| Assignment String Expression
| Sequence [Operator]
| If Expression Operator Operator
| While Expression Operator
type Context = [(String, Expression)]
interpret :: Operator -> Context -> Context
eval :: Expression -> Context -> Expression
eval v@(Integral n) _ = v
eval v@(Logical b) _ = v
eval (Variable x) ctx = assoc x ctx
eval (Unary op ex) ctx = intrinsic op [eval ex ctx]
eval (Binary e1 op e2) ctx = intrinsic op [eval e1 ctx, eval e2 ctx]
intrinsic "+" [(Integral a), (Integral b)] = Integral (a+b)
intrinsic "-" [(Integral a)] = Integral (-a)
intrinsic "and" [(Logical a), (Logical b)] = Logical (a && b)
intrinsic :: String -> [Expression] -> Expression
4. 4
Кубенский А.А. Функциональное программирование.
Глава 5. Системы исполнения функциональных программ.
Исполнение операторов.
replace :: String -> Expression -> Context -> Context
replace x val = map ((y,v) -> (y,if x == y then val else v))
replace "f" (Integral 20) [("n", (Integral 4)), ("f", (Integral 5))]
Например:
даст в результате [("n", (Integral 4)), ("f", (Integral 20))]
interpret :: Operator -> Context -> Context
interpret Skip ctx = ctx
interpret (Assignment x expr) ctx = replace x (eval expr ctx) ctx
interpret (Sequence []) ctx = ctx
interpret (Sequence (s:seq)) ctx = interpret (Sequence seq) (interpret s ctx)
interpret (If expr s1 s2) ctx = case (eval expr ctx) of
(Logical True) -> interpret s1 ctx
(Logical False) -> interpret s2 ctx
interpret oper@(While expr s) ctx = case (eval expr ctx) of
(Logical True) -> interpret oper (interpret s ctx)
(Logical False) -> ctx
5. 5
Кубенский А.А. Функциональное программирование.
Глава 5. Системы исполнения функциональных программ.
Пример компиляции и исполнения программы
begin f := 1;
while n > 1 do begin
f := f * n;
n := n – 1
end
end
program =
Sequence
[(Assignment "f" (Integral 1)),
(While
(Binary (Variable "n") ">" (Integral 1))
(Sequence
[(Assignment "f" (Binary (Variable "f") "*" (Variable "n"))),
(Assignment "n" (Binary (Variable "n") "-" (Integral 1)))]))
]
compile program - функция преобразования контекстов
interpret program [("f", (Integral 0)), ("n", (Integral 3))]
[("f", (Integral 6)), ("n", (Integral 0))]
6. 6
Кубенский А.А. Функциональное программирование.
Глава 6. Введение в редукцию графов.
Глава 6. Введение в редукцию графов
6.1. Представление лямбда-выражений в виде графов
Будем исходить из представления программ в виде структур данных расширенного лямбда-
исчисления. Наша основная задача – корректно представить концепцию разделения переменных.
Константа c. c
Примитивная функция f. f
Лямбда-выражение λx.E.
λ
x E
Применение функции E1 E2.
@
E1 E2
Применение конструктора C x y z.
C
x zy
7. 7
Кубенский А.А. Функциональное программирование.
Особенности представления некоторых типов выражений.
Представление лямбда-выражений в виде графов (продолжение).
Глава 6. Введение в редукцию графов.
Частичное применений примитивных функций и конструкторов.
1+2 + 1 2 + 1
@
+ 1
@
2
@
+ 1
1 : lst : 1 lst
:
1 lst
: 1
@
: 1
или :
1 t
λ
t
8. 8
Кубенский А.А. Функциональное программирование.
Представление лямбда-выражений в виде графов (продолжение).
Глава 6. Введение в редукцию графов.
Блоки let x = E1 in E2 и letrec x1 = E1;... xk = Ek in E.
let x = E1 in E2 (λx.E2) E1
E2
λ
x
@
E1
letrec x1 = E1;... xk = Ek in E – моделируется с помощью циклических графов.
9. 9
Кубенский А.А. Функциональное программирование.
let twice = λf.λx.f (f x) in twice (λx.+ x 1) 2
Пример представления выражения в виде графа.
Глава 6. Введение в редукцию графов.
(λf.λx.f (f x)) (λx.+ x 1) 2
2
λ
x
λ
f
f
@
x
@
f
λ
@
@
x @
@
+ x
1
10. 10
Кубенский А.А. Функциональное программирование.
• Нахождение самого левого из самых внешних редексов: проход по «левому гребню» графа.
Правила редукции графов.
Глава 6. Введение в редукцию графов.
2
x
x
@
succ
λ
@
• Копирование тела лямбда-выражения.
x
@
succ
• Подстановка аргумента вместо свободных вхождений переменной лямбда-выражения в тело.
• Замещение в дереве @-узла результатом «вычислений».
Некоторые особенности этой процедуры:
• Тело лямбда-выражения копируется, чтобы его можно было переиспользовать; «мусор»
удаляется
• Подстановка аргументов производится с помощью установки ссылок; тем самым
производится эффективное разделение переменных
• Результат редукции замещает редуцируемое выражение, тем самым все ссылки на этот
результат будут иметь новое значение
11. 11
Кубенский А.А. Функциональное программирование.
Пример редукции графов.
Глава 6. Введение в редукцию графов.
(λf.λx.f (f x)) (λx.+ x 1) 2
2
λ
x
λ
f
f
@
x
@
f
λ
@
@
x @
@
+ x
1
12. 12
Кубенский А.А. Функциональное программирование.
Глава 6. Введение в редукцию графов.
2
λ
@
@
x @
@
+ x
1
Пример редукции графов.
(λf.λx.f (f x)) (λx.+ x 1) 2
@
@
+
1
3
4
13. 13
Кубенский А.А. Функциональное программирование.
δ-редукция в графовом представлении
Глава 6. Введение в редукцию графов.
Если при проходе по левому гребню находим константу, то это – примитивная функция
2
+
@
3
@
- сначала выполняем редукцию всех строгих аргументов;
- потом формируем результат в соответствии с правилами этой примитивной функции;
- результат замещает собой корень редекса.
@
@
*
6
12
14. 14
Кубенский А.А. Функциональное программирование.
Общий алгоритм редукции графов (пока без учета рекурсии)
Глава 6. Введение в редукцию графов.
while (выражение не находится в СЗНФ) {
спуск от корня по левому гребню до первой вершины, отличной от @-вершины;
switch (тип вершины) {
case (примитивная функция):
if (число аргументов k > числа пройденных @-вершин)
выражение находится в СЗНФ;
else {
редуцировать все строгие аргументы;
сформировать результат согласно правилам примитивной функции;
заменить k-ю @-вершину этим результатом;
}
break;
case (λ-вершина):
if (выше нет @-вершин)
выражение находится в СЗНФ;
else {
создать копию тела с подстановкой (разделяемого) аргумента
вместо свободных вхождений переменной λ-выражения;
подставить результат вместо вершины редекса (первая @-вершина вверх по гребню);
}
break;
default: // константа-значение или конструктор
if (выше нет @-вершин)
выражение находится в СЗНФ;
else
ошибка типа !
break;
}
}
15. 15
Кубенский А.А. Функциональное программирование.
Использование вершин-синонимов
Глава 6. Введение в редукцию графов.
При выполнении редукций есть одна проблема, связанная с копированием: в теле функции
переменная может быть в корне. Тогда вместо подстановки ссылки на аргумент придется делать
копию вершины, представляющей аргумент.
+
@
λ
@
x
1
2
x
@
x
@
Можно вместо копирования вершины создавать «вершину-синоним» - «прозрачную» по ссылкам.
Θ
При прохождении вершины-синонима можно оптимизировать их количество, убирать двойные
синонимы, заменять ссылки на синоним ссылками на саму вершину.
16. 16
Кубенский А.А. Функциональное программирование.
Использование вершин-синонимов (продолжение)
Глава 6. Введение в редукцию графов.
Аналогичная проблема возникает при применении примитивных функций-селекторов, которые
не преобразуют, а просто выдают аргумент или его часть (например, head или tail).
head
head
@
@
:
:
1 nil
nil
head (cons (head (cons 1 nil)) nil)
Θ
Θ