SlideShare a Scribd company logo
Introduction of Linear Logic
Sosuke MORIGUCHI
Agenda
 Linear Logic
 Viewpoint of Linear Logic
 Definition and Examples
 Computations
 Typed Lambda Calculus
 Linear Lisp Machine
Book
 LECTURES ON LINEAR LOGIC
 A. S. Troelstra
 CSLI Lectures Notes Number 29
 You can download pdf file of this book from
http://standish.stanford.edu/bin/object?00000065
 Chapter 6 is mainly used.
Viewpoint of Linear Logic
 In linear logic, we can use each hypothesis
just once.
 Strictly speaking, it’s not correct...
 This formula is not valid in linear logic.
(A -> B -> C) -> (A -> B) -> A -> C
 Because we need to use predicate “A” twice.
 This formula is valid.
(A -> B) -> (B -> C) -> A -> C
 Because each subformula is used only once.
Natural Deduction
 In this explanation, we use natural
deduction to construct proof trees.
 With contexts (i.e. lists of hypotheses).
 Syntax
 Γ├ A
 “Formula A is derived from context Γ.”
 Axioms
 A├ A
 Not Γ, A├ A
Linear Logic with
Natural Deduction
 Many handbooks for linear logic use
sequent calculus.
 But some of you may not know about sequent
calculus, so I won’t use.
 The book I read also explains about natural
deduction.
 In linear sequent calculus, there are neither
contraction nor weakening rules.
Linear Implication
 We use -○ for implication in linear logic.
 A -○ B means that “B is proved with just one
formula A”.
 We use following formulae as examples.
 (A -○ B) -○ (B -○ C) -○ A -○ C
 (A -○ B -○ C) -○ (A -○ B) -○ A -○ C
Linear Implication in
Natural Deduction
 Introduction rule
Γ, A├ B
Γ├ A -○ B
 Extract rule
Γ├ A -○ B Δ├ A
Γ, Δ├ B
Example
(A -○ B) -○ (B -○ C) -○ A -○ C
A –○ B├ A -○ B A├ A
B -○ C├ B -○ C A -○ B, A├ B
A -○ B, B -○ C, A├ C
A -○ B, B -○ C├ A -○ C
A -○ B├ (B -○ C) -○ A -○ C
├ (A -○ B) -○ (B -○ C) -○ A -○ C
Failure about proof 1
A -○ B -○ C├ A -○ B -○ C A├ A A-○ B├ A -○ B ├ A ??
A -○ B -○ C, A├ B -○ C A -○ B├ B
A -○ B -○ C, A -○ B, A├ C
A -○ B -○ C, A -○ B├ A -○ C
A -○ B -○ C├ (A -○ B) -○ A -○ C
├ (A -○ B -○ C) -○ (A -○ B) -○ A -○ C
Failure about proof 2
A -○ B -○ C├ A -○ B -○ C ├ A ?? A-○ B├ A -○ B A├ A
A -○ B -○ C├ B -○ C A -○ B, A├ B
A -○ B -○ C, A -○ B, A├ C
A -○ B -○ C, A -○ B├ A -○ C
A -○ B -○ C├ (A -○ B) -○ A -○ C
├ (A -○ B -○ C) -○ (A -○ B) -○ A -○ C
Other structures
(logical operators)
 NOT
 Or falsefood (with implication).
 AND
 OR
 There are two types for each operator.
 Contextual
 Context-free
Contextual and Context-free
 These kinds are based on operators’ rules.
 If a rule has a restriction for contexts of
hypotheses in the rule, then the operator is
contextual, otherwise context-free.
 Linear implication is context-free one.
 Contextual implication is also definable, but its
rules are hard to describe in natural deduction.
Falsehood
 Context-free
 0
Γ, A -○ 0├ 0
Γ├ A
 NOT A = A -○ 0.
 Above rule can be
viewed as “double
negation elimination”.
 Contextual
 ⏊
Γ, ⏊├ A
 I can’t explain why this
is “contextual” and left
one is “context-free”...
Example
((A -○ 0) -○ 0) -○ A
 ...very simple...
(A -○ 0) -○ 0├ (A -○ 0) -○ 0 A -○ 0├ A -○ 0
(A -○ 0) -○ 0, A -○ 0├ 0
(A -○ 0) -○ 0├ A
├ ((A -○ 0) -○ 0) -○ A
AND
 Context-free
 A★B
Γ├ A Δ├ B
Γ, Δ├ A★B
Γ├ A★B Δ, A, B├ C
Γ, Δ├ C
 Contextual
 A∩B
Γ├ A Γ├ B
Γ ├ A∩B
Γ├ A∩B Γ├ A∩B
Γ├ A Γ├ B
Example 1
(A -○ B)★C -○ A -○ B★C
A -○ B├ A -○ B A├ A
A, A -○ B├ B C├ C
(A -○ B)★B├ (A -○ B)★B A, A -○ B, C├ B★C
(A -○ B)★C, A├ B★C
(A -○ B)★C├ A -○ B★C
├ (A -○ B)★C -○ A -○ B★C
Example 2
(A -○ B)∩(A -○ C) -○ A -○ B∩C
(A -○ B)∩(A -○ C)├ (A -○ B)∩(A -○ C) (A -○ B)∩(A -○ C)├ (A -○ B)∩(A -○ C)
(A -○ B)∩(A -○ C)├ A -○ B A├ A (A -○ B)∩(A -○ C)├ A -○ C A├ A
(A -○ B)∩(A -○ C), A├ B (A -○ B)∩(A -○ C), A├ C
(A -○ B)∩(A -○ C), A├ B∩C
(A -○ B)∩(A -○ C)├ A -○ B∩C
├ (A -○ B)∩(A -○ C) -○ A -○ B∩C
OR
 Context-free
 A+B
 OR is hard to describe
in natural deduction,
like contextual
implication.
 Dual operator of ★.
 ~(A★B) = ~A+~B
 ~A = A -○ 0
 Contextual
 A∪B
 Dual operator of ∩.
 ~(A∩B) = ~A∪~B
Γ├ A
Γ├ A∪B
Γ├ A∪B
A, Δ├ C B, Δ├ C
Γ, Δ├ C
Example
(C -○ A)∪(C -○ B) -○ C -○ A∪B
C -○ A├ C -○ A C├ C C -○ B├ C -○ B C├ C
C -○ A, C├ A C -○ B, C├ B
(C -○ A)∪(C -○ B)├ (C -○ A)∪(C -○ B) C -○ A, C├ A∪B C -○ B, C├ A∪B
(C -○ A)∪(C -○ B), C├ A∪B
(C -○ A)∪(C -○ B)├ C -○ A∪B
├ (C -○ A)∪(C -○ B) -○ C -○ A∪B
Special Operator : Storage !A
 A storage formula !A denotes any number
of formula A.
Γ├ !B Δ, !B, !B├ A Γ├ !B Δ├ A
Γ, Δ├ A Γ, Δ├ A
Γ├ !B Δ, B├ A !Γ├ B
Γ, Δ├ A !Γ├ !B
 !Γ means that all hypotheses in Γ are storage
formulae.
Example
(A -○ B -○ C) -○ (A -○ B) -○ !A -○ C
A -○ B -○ C├ A -○ B -○ C A├ A A -○ B├ A -○ B A├ A
!A├ !A A -○ B -○ C, A├ B -○ C !A├ !A A -○ B, A├ B
A -○ B -○ C, !A├ B -○ C A -○ B, !A├ B
!A├ !A A -○ B -○ C, A -○ B, !A, !A├ C
A -○ B -○ C, A -○ B, !A├ C
A -○ B -○ C, A -○ B├ !A -○ C
A -○ B -○ C├ (A -○ B) -○ !A -○ C
├ (A -○ B -○ C) -○ (A -○ B) -○ !A -○ C
Computations
 Typed Lambda Calculus
 Linear Lisp Machine
Curry-Howard Isomorphism
 Relationship between typed lambda terms
and logical formulae.
 typing rule  derivation rule (axiom)
 typed lambda term  proof
 Here, we use intuitional linear logic, which
does not have double negation elimination
rule.
Linear Lambda Terms
Γ, x : A├ t : B
Γ├ λxA. t : A -○ B
Γ├ s : A -○ B Δ├ t : A
Γ, Δ├ (s t) : B
...Other rules are omitted.
(They are same forms as formulae.)
Example 1
 λfA-○B. λgB-○C. λaA. (g (f a))
: (A -○ B) -○ (B -○ C) -○ A -○ C
 λs(A-○B)★C.λaA.let (xA-○B★yC)=s in (x a)★y
: (A -○ B)★C -○ A -○ B★C
 λs(A-○B)∩(A-○C).λaA.((π0 s) a)∩((π1 s) a)
: (A -○ B)∩(A -○ C) -○ A -○ B∩C
 λs(C-○A)∪(C-○B).λcC. match s with
| fC-○A=>(κ0 (f c)) | gC-○B=>(κ1 (g c)).
: (C -○ A)∪(C -○ B) -○ C -○ A∪B
Example 2
 λfA-○B-○C.λgA-○B.λx!A.let (s!A,t!A)=copy(x) in
(let aA = load(s) in (f a)
let bA = load(t) in (g b))
: (A -○ B -○ C) -○ (A -○ B) -○ !A -○ C
 λfA-○B-○C.λgA-○B.λx!A.let (s!A,t!A)=copy(x) in
let aA = load(s) in let bA = load(t) in
((f a) (g b))
: (A -○ B -○ C) -○ (A -○ B) -○ !A -○ C
 ...etc
Linear Lisp
 Lively Linear Lisp – ‘Look Ma, No Garbage!’
 Henry G. Baker
 Nimble Computer Corporation
 ACM SIGPLAN Notices 27, 8(Aug. 1992),
89-98.
Linear Lisp (Machine)
 Linear Lisp has
 nil, cons cells and symbols.
 11 (atomic) operations.
 And some logical function.
 Linear Lisp does not require garbage
collection.
 Linear Lisp is not based on linear logic...
 Only “NO DATA SHARING IN PROGRAMS”.
Operations (1/3)
 rn : n-th register (variable)
 (<-> r1 r2)
 swap r1, r2
 (<-> r1 (CAR r2))
 (<-> r1 (CDR r2))
 r1 and r2 must be distinct, and r2 must not be
ATOM (neither nil nor symbol).
Operations (2/3)
 (NULL r1)
 Predicate for (= r1 NIL)
 (ATOM r1)
 Predicate for (or (= r1 NIL) (symbol? r1))
 (EQ r1 r2)
 Precondition : (and (ATOM r1) (ATOM r2))
 (:= r1 ‘foo)
 Precondition : (ATOM r1)
Operations (3/3)
 (:= r1 r2)
 Precondition : (and (ATOM r1) (ATOM r2))
 (CONS r1 r2)
 r2 becomes (cons r1 r2), and r1 becomes nil.
 (PUSH r1 r2)
 Same as CONS
 (POP r1 r2)
 Precondition :(and (NULL r1) (not (ATOM r2)))
 r2 becomes (cdr r2), and r1 becomes (car r2).
Proposition
 Reference counts of all cons cell in linear
lisp programs are 1.
 Cons cells are created when CONS (or PUSH)
operations are executed, and destroyed when
POP operations are executed.
 So if one cons cell is not accessible, then it is
destroyed soon.
CAUTION!
 Previous proposition is not one on the
paper.
 In the paper, auther uses “free register”,
which is infinite long list and elements of the
list are all nil.
 Reference counts of all lists are always identically 1.
 All cons cells are always accessible – i.e. live.
 No garbage is created.
 The name of the paper would be based on these
propositions.
Other operations
 We can construct some operations with
above operations.
 (FREE r1)
 r1 becomes nil.
 (COPY r1 r2)
 If r2 is nil, r2 becomes the same as r1.
 Not sharing cell.
 (EQUAL r1 r2)
 Recursive list equality.
FREE
(FREE r1) :
(if (not (NULL r1)
(if (ATOM r1) (:= r1 ‘nil)
(progn (PUSH r2 sp) (POP r2 r1)
(FREE r1)
(<-> r2 r1)
(FREE r1)
(POP r2 sp))))
COPY
(COPY r1 r2) : ; r2 = ‘nil
(if (not (NULL r1))
(if (ATOM r1) (:= r2 r1)
(progn
(PUSH t1 sp) (PUSH t2 sp)
(POP t1 r1) (COPY r1 r2)
(<-> t1 r1) (<-> t2 r2) (COPY r1 r2)
(<-> t1 r1) (<-> t2 r2)
(PUSH t1 r1) (PUSH t2 r2)
(POP t2 sp) (POP t1 sp))))
EQUAL
(EQUAL r1 r2) :
(or (and (ATOM r1) (ATOM r2) (EQ r1 r2))
(and (not (ATOM r1)) (not (ATOM r2))
(progn
(PUSH t1 sp) (PUSH t2 sp)
(POP t1 r1) (POP t2 r2)
(prog1
(and (EQUAL r1 r2)
(progn (<-> t1 r1) (<-> t2 r2)
(prog1 (EQUAL r1 r2)
(<-> t1 r1) (<-> t2 r2))))
(PUSH t1 r1) (PUSH t2 r2)
(POP t2 sp) (POP t1 sp)))))
Traditional Lisp Interpreter
 Auther says that we can program a
traditional lisp interpreter, but there is no
such a program in the paper.
 Instead of it, there is a metacircular linear lisp
interpreter.
 It needs quote, back-quote, and macros...
 The interpreter is inefficient, due to the
extra expense of copying.
And ...
 The rest of paper is about how to use
linear lisp in multiprocessing...
 But I don’t want to talk about that.
 So, that’s all for my talk.

More Related Content

What's hot

Chomsky Normal Form
Chomsky Normal FormChomsky Normal Form
Chomsky Normal Form
Jasmine Peniel
 
Ch06
Ch06Ch06
Ch06
Hankyo
 
Discussion of Fearnhead and Prangle, RSS&lt; Dec. 14, 2011
Discussion of Fearnhead and Prangle, RSS&lt; Dec. 14, 2011Discussion of Fearnhead and Prangle, RSS&lt; Dec. 14, 2011
Discussion of Fearnhead and Prangle, RSS&lt; Dec. 14, 2011
Christian Robert
 
Snehal latin square design (rm seminaar)
Snehal latin square design (rm seminaar)Snehal latin square design (rm seminaar)
Snehal latin square design (rm seminaar)
snehal dhobale
 
Persistent Homology and Nested Dissection
Persistent Homology and Nested DissectionPersistent Homology and Nested Dissection
Persistent Homology and Nested DissectionDon Sheehy
 
Ch03
Ch03Ch03
Ch03
Hankyo
 
Euler
EulerEuler
18 polar coordinates x
18 polar coordinates x18 polar coordinates x
18 polar coordinates x
math260
 
11. polar equations and graphs x
11. polar equations and graphs x11. polar equations and graphs x
11. polar equations and graphs x
harbormath240
 
10. polar coordinates x
10. polar coordinates x10. polar coordinates x
10. polar coordinates x
harbormath240
 
Totally R*-Continuous and Totally R*-Irresolute Functions
Totally R*-Continuous and Totally R*-Irresolute FunctionsTotally R*-Continuous and Totally R*-Irresolute Functions
Totally R*-Continuous and Totally R*-Irresolute Functions
inventionjournals
 
Pc 10.7 notes_polar
Pc 10.7 notes_polarPc 10.7 notes_polar
Pc 10.7 notes_polar
Jonathan Fjelstrom
 
Non determinism through type isomophism
Non determinism through type isomophismNon determinism through type isomophism
Non determinism through type isomophism
Alejandro Díaz-Caro
 
Otter 2014-12-08-02
Otter 2014-12-08-02Otter 2014-12-08-02
Otter 2014-12-08-02
Ruo Ando
 
First and follow set
First and follow setFirst and follow set
First and follow set
Dawood Faheem Abbasi
 

What's hot (20)

Chomsky Normal Form
Chomsky Normal FormChomsky Normal Form
Chomsky Normal Form
 
Ch06
Ch06Ch06
Ch06
 
Discussion of Fearnhead and Prangle, RSS&lt; Dec. 14, 2011
Discussion of Fearnhead and Prangle, RSS&lt; Dec. 14, 2011Discussion of Fearnhead and Prangle, RSS&lt; Dec. 14, 2011
Discussion of Fearnhead and Prangle, RSS&lt; Dec. 14, 2011
 
Snehal latin square design (rm seminaar)
Snehal latin square design (rm seminaar)Snehal latin square design (rm seminaar)
Snehal latin square design (rm seminaar)
 
Persistent Homology and Nested Dissection
Persistent Homology and Nested DissectionPersistent Homology and Nested Dissection
Persistent Homology and Nested Dissection
 
Polar coordinates
Polar coordinatesPolar coordinates
Polar coordinates
 
Ch03
Ch03Ch03
Ch03
 
Euler
EulerEuler
Euler
 
18 polar coordinates x
18 polar coordinates x18 polar coordinates x
18 polar coordinates x
 
MSc_thesis
MSc_thesisMSc_thesis
MSc_thesis
 
11. polar equations and graphs x
11. polar equations and graphs x11. polar equations and graphs x
11. polar equations and graphs x
 
10. polar coordinates x
10. polar coordinates x10. polar coordinates x
10. polar coordinates x
 
Totally R*-Continuous and Totally R*-Irresolute Functions
Totally R*-Continuous and Totally R*-Irresolute FunctionsTotally R*-Continuous and Totally R*-Irresolute Functions
Totally R*-Continuous and Totally R*-Irresolute Functions
 
Pc 10.7 notes_polar
Pc 10.7 notes_polarPc 10.7 notes_polar
Pc 10.7 notes_polar
 
Polar Co Ordinates
Polar Co OrdinatesPolar Co Ordinates
Polar Co Ordinates
 
07 vectors
07   vectors07   vectors
07 vectors
 
Topdown parsing
Topdown parsingTopdown parsing
Topdown parsing
 
Non determinism through type isomophism
Non determinism through type isomophismNon determinism through type isomophism
Non determinism through type isomophism
 
Otter 2014-12-08-02
Otter 2014-12-08-02Otter 2014-12-08-02
Otter 2014-12-08-02
 
First and follow set
First and follow setFirst and follow set
First and follow set
 

Similar to Linear logic (and Linear Lisp)

Functional Programming.pptx
Functional Programming.pptxFunctional Programming.pptx
Functional Programming.pptx
PremBorse1
 
3.3 Logarithmic Functions
3.3 Logarithmic Functions3.3 Logarithmic Functions
3.3 Logarithmic Functions
Victoria Ryburn
 
10-SLR parser practice problems-02-06-2023.pptx
10-SLR parser practice problems-02-06-2023.pptx10-SLR parser practice problems-02-06-2023.pptx
10-SLR parser practice problems-02-06-2023.pptx
venkatapranaykumarGa
 
On the proof theory for Description Logics
On the proof theory for Description LogicsOn the proof theory for Description Logics
On the proof theory for Description Logics
Alexandre Rademaker
 
Lex analysis
Lex analysisLex analysis
Lex analysis
Suhit Kulkarni
 
Truth, deduction, computation lecture g
Truth, deduction, computation   lecture gTruth, deduction, computation   lecture g
Truth, deduction, computation lecture g
Vlad Patryshev
 
[系列活動] Data exploration with modern R
[系列活動] Data exploration with modern R[系列活動] Data exploration with modern R
[系列活動] Data exploration with modern R
台灣資料科學年會
 
Syntactic analysis in NLP
Syntactic analysis in NLPSyntactic analysis in NLP
Syntactic analysis in NLP
kartikaVashisht
 
C2.0 propositional logic
C2.0 propositional logicC2.0 propositional logic
C2.0 propositional logic
Melaku Bayih Demessie
 
Ch 2 lattice & boolean algebra
Ch 2 lattice & boolean algebraCh 2 lattice & boolean algebra
Ch 2 lattice & boolean algebra
Rupali Rana
 
Programming Hp33s talk v3
Programming Hp33s talk v3Programming Hp33s talk v3
Programming Hp33s talk v3
Land Surveyors United Community
 
Scheme 核心概念(一)
Scheme 核心概念(一)Scheme 核心概念(一)
Scheme 核心概念(一)
維然 柯維然
 
Program Derivation of Matrix Operations in GF
Program Derivation of Matrix Operations in GFProgram Derivation of Matrix Operations in GF
Program Derivation of Matrix Operations in GF
Charles Southerland
 
Exponents and Logs
Exponents and LogsExponents and Logs
Exponents and Logs
Neil MacIntosh
 
Otter 2016-11-28-01-ss
Otter 2016-11-28-01-ssOtter 2016-11-28-01-ss
Otter 2016-11-28-01-ss
Ruo Ando
 
Numerical Solution of Linear algebraic Equation
Numerical Solution of Linear algebraic EquationNumerical Solution of Linear algebraic Equation
Numerical Solution of Linear algebraic Equation
payalpriyadarshinisa1
 
Functional Concepts for OOP Developers
Functional Concepts for OOP DevelopersFunctional Concepts for OOP Developers
Functional Concepts for OOP Developers
brweber2
 

Similar to Linear logic (and Linear Lisp) (20)

Functional Programming.pptx
Functional Programming.pptxFunctional Programming.pptx
Functional Programming.pptx
 
3.3 Logarithmic Functions
3.3 Logarithmic Functions3.3 Logarithmic Functions
3.3 Logarithmic Functions
 
10-SLR parser practice problems-02-06-2023.pptx
10-SLR parser practice problems-02-06-2023.pptx10-SLR parser practice problems-02-06-2023.pptx
10-SLR parser practice problems-02-06-2023.pptx
 
On the proof theory for Description Logics
On the proof theory for Description LogicsOn the proof theory for Description Logics
On the proof theory for Description Logics
 
Lex analysis
Lex analysisLex analysis
Lex analysis
 
Truth, deduction, computation lecture g
Truth, deduction, computation   lecture gTruth, deduction, computation   lecture g
Truth, deduction, computation lecture g
 
[系列活動] Data exploration with modern R
[系列活動] Data exploration with modern R[系列活動] Data exploration with modern R
[系列活動] Data exploration with modern R
 
Syntactic analysis in NLP
Syntactic analysis in NLPSyntactic analysis in NLP
Syntactic analysis in NLP
 
C2.0 propositional logic
C2.0 propositional logicC2.0 propositional logic
C2.0 propositional logic
 
Ch 2 lattice & boolean algebra
Ch 2 lattice & boolean algebraCh 2 lattice & boolean algebra
Ch 2 lattice & boolean algebra
 
Cs501 rel algebra
Cs501 rel algebraCs501 rel algebra
Cs501 rel algebra
 
Programming Hp33s talk v3
Programming Hp33s talk v3Programming Hp33s talk v3
Programming Hp33s talk v3
 
Scheme 核心概念(一)
Scheme 核心概念(一)Scheme 核心概念(一)
Scheme 核心概念(一)
 
Program Derivation of Matrix Operations in GF
Program Derivation of Matrix Operations in GFProgram Derivation of Matrix Operations in GF
Program Derivation of Matrix Operations in GF
 
Exponents and Logs
Exponents and LogsExponents and Logs
Exponents and Logs
 
Otter 2016-11-28-01-ss
Otter 2016-11-28-01-ssOtter 2016-11-28-01-ss
Otter 2016-11-28-01-ss
 
Numerical Solution of Linear algebraic Equation
Numerical Solution of Linear algebraic EquationNumerical Solution of Linear algebraic Equation
Numerical Solution of Linear algebraic Equation
 
presentation
presentationpresentation
presentation
 
Functional Concepts for OOP Developers
Functional Concepts for OOP DevelopersFunctional Concepts for OOP Developers
Functional Concepts for OOP Developers
 
Big o
Big oBig o
Big o
 

More from Sosuke MORIGUCHI

Summerseminar2019
Summerseminar2019Summerseminar2019
Summerseminar2019
Sosuke MORIGUCHI
 
PEGの回文っぽいExpression
PEGの回文っぽいExpressionPEGの回文っぽいExpression
PEGの回文っぽいExpression
Sosuke MORIGUCHI
 
fibsを読む
fibsを読むfibsを読む
fibsを読む
Sosuke MORIGUCHI
 
ProofSummit2014 : VSTでCの検証
ProofSummit2014 : VSTでCの検証ProofSummit2014 : VSTでCの検証
ProofSummit2014 : VSTでCの検証
Sosuke MORIGUCHI
 
Nagoya Matsuri 2013 ぐだぐだAgda
Nagoya Matsuri 2013 ぐだぐだAgdaNagoya Matsuri 2013 ぐだぐだAgda
Nagoya Matsuri 2013 ぐだぐだAgda
Sosuke MORIGUCHI
 
ProofSummit2013 べらべらAbella
ProofSummit2013 べらべらAbellaProofSummit2013 べらべらAbella
ProofSummit2013 べらべらAbella
Sosuke MORIGUCHI
 
A/F/C-orientation
A/F/C-orientationA/F/C-orientation
A/F/C-orientation
Sosuke MORIGUCHI
 
Proof Summit 2012
Proof Summit 2012Proof Summit 2012
Proof Summit 2012
Sosuke MORIGUCHI
 
Curry-Howard同型から単純型付ラムダ計算の項を作る
Curry-Howard同型から単純型付ラムダ計算の項を作るCurry-Howard同型から単純型付ラムダ計算の項を作る
Curry-Howard同型から単純型付ラムダ計算の項を作る
Sosuke MORIGUCHI
 
Cartesian Closed Category
Cartesian Closed CategoryCartesian Closed Category
Cartesian Closed Category
Sosuke MORIGUCHI
 

More from Sosuke MORIGUCHI (10)

Summerseminar2019
Summerseminar2019Summerseminar2019
Summerseminar2019
 
PEGの回文っぽいExpression
PEGの回文っぽいExpressionPEGの回文っぽいExpression
PEGの回文っぽいExpression
 
fibsを読む
fibsを読むfibsを読む
fibsを読む
 
ProofSummit2014 : VSTでCの検証
ProofSummit2014 : VSTでCの検証ProofSummit2014 : VSTでCの検証
ProofSummit2014 : VSTでCの検証
 
Nagoya Matsuri 2013 ぐだぐだAgda
Nagoya Matsuri 2013 ぐだぐだAgdaNagoya Matsuri 2013 ぐだぐだAgda
Nagoya Matsuri 2013 ぐだぐだAgda
 
ProofSummit2013 べらべらAbella
ProofSummit2013 べらべらAbellaProofSummit2013 べらべらAbella
ProofSummit2013 べらべらAbella
 
A/F/C-orientation
A/F/C-orientationA/F/C-orientation
A/F/C-orientation
 
Proof Summit 2012
Proof Summit 2012Proof Summit 2012
Proof Summit 2012
 
Curry-Howard同型から単純型付ラムダ計算の項を作る
Curry-Howard同型から単純型付ラムダ計算の項を作るCurry-Howard同型から単純型付ラムダ計算の項を作る
Curry-Howard同型から単純型付ラムダ計算の項を作る
 
Cartesian Closed Category
Cartesian Closed CategoryCartesian Closed Category
Cartesian Closed Category
 

Recently uploaded

Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 

Recently uploaded (20)

Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 

Linear logic (and Linear Lisp)

  • 1. Introduction of Linear Logic Sosuke MORIGUCHI
  • 2. Agenda  Linear Logic  Viewpoint of Linear Logic  Definition and Examples  Computations  Typed Lambda Calculus  Linear Lisp Machine
  • 3. Book  LECTURES ON LINEAR LOGIC  A. S. Troelstra  CSLI Lectures Notes Number 29  You can download pdf file of this book from http://standish.stanford.edu/bin/object?00000065  Chapter 6 is mainly used.
  • 4. Viewpoint of Linear Logic  In linear logic, we can use each hypothesis just once.  Strictly speaking, it’s not correct...  This formula is not valid in linear logic. (A -> B -> C) -> (A -> B) -> A -> C  Because we need to use predicate “A” twice.  This formula is valid. (A -> B) -> (B -> C) -> A -> C  Because each subformula is used only once.
  • 5. Natural Deduction  In this explanation, we use natural deduction to construct proof trees.  With contexts (i.e. lists of hypotheses).  Syntax  Γ├ A  “Formula A is derived from context Γ.”  Axioms  A├ A  Not Γ, A├ A
  • 6. Linear Logic with Natural Deduction  Many handbooks for linear logic use sequent calculus.  But some of you may not know about sequent calculus, so I won’t use.  The book I read also explains about natural deduction.  In linear sequent calculus, there are neither contraction nor weakening rules.
  • 7. Linear Implication  We use -○ for implication in linear logic.  A -○ B means that “B is proved with just one formula A”.  We use following formulae as examples.  (A -○ B) -○ (B -○ C) -○ A -○ C  (A -○ B -○ C) -○ (A -○ B) -○ A -○ C
  • 8. Linear Implication in Natural Deduction  Introduction rule Γ, A├ B Γ├ A -○ B  Extract rule Γ├ A -○ B Δ├ A Γ, Δ├ B
  • 9. Example (A -○ B) -○ (B -○ C) -○ A -○ C A –○ B├ A -○ B A├ A B -○ C├ B -○ C A -○ B, A├ B A -○ B, B -○ C, A├ C A -○ B, B -○ C├ A -○ C A -○ B├ (B -○ C) -○ A -○ C ├ (A -○ B) -○ (B -○ C) -○ A -○ C
  • 10. Failure about proof 1 A -○ B -○ C├ A -○ B -○ C A├ A A-○ B├ A -○ B ├ A ?? A -○ B -○ C, A├ B -○ C A -○ B├ B A -○ B -○ C, A -○ B, A├ C A -○ B -○ C, A -○ B├ A -○ C A -○ B -○ C├ (A -○ B) -○ A -○ C ├ (A -○ B -○ C) -○ (A -○ B) -○ A -○ C
  • 11. Failure about proof 2 A -○ B -○ C├ A -○ B -○ C ├ A ?? A-○ B├ A -○ B A├ A A -○ B -○ C├ B -○ C A -○ B, A├ B A -○ B -○ C, A -○ B, A├ C A -○ B -○ C, A -○ B├ A -○ C A -○ B -○ C├ (A -○ B) -○ A -○ C ├ (A -○ B -○ C) -○ (A -○ B) -○ A -○ C
  • 12. Other structures (logical operators)  NOT  Or falsefood (with implication).  AND  OR  There are two types for each operator.  Contextual  Context-free
  • 13. Contextual and Context-free  These kinds are based on operators’ rules.  If a rule has a restriction for contexts of hypotheses in the rule, then the operator is contextual, otherwise context-free.  Linear implication is context-free one.  Contextual implication is also definable, but its rules are hard to describe in natural deduction.
  • 14. Falsehood  Context-free  0 Γ, A -○ 0├ 0 Γ├ A  NOT A = A -○ 0.  Above rule can be viewed as “double negation elimination”.  Contextual  ⏊ Γ, ⏊├ A  I can’t explain why this is “contextual” and left one is “context-free”...
  • 15. Example ((A -○ 0) -○ 0) -○ A  ...very simple... (A -○ 0) -○ 0├ (A -○ 0) -○ 0 A -○ 0├ A -○ 0 (A -○ 0) -○ 0, A -○ 0├ 0 (A -○ 0) -○ 0├ A ├ ((A -○ 0) -○ 0) -○ A
  • 16. AND  Context-free  A★B Γ├ A Δ├ B Γ, Δ├ A★B Γ├ A★B Δ, A, B├ C Γ, Δ├ C  Contextual  A∩B Γ├ A Γ├ B Γ ├ A∩B Γ├ A∩B Γ├ A∩B Γ├ A Γ├ B
  • 17. Example 1 (A -○ B)★C -○ A -○ B★C A -○ B├ A -○ B A├ A A, A -○ B├ B C├ C (A -○ B)★B├ (A -○ B)★B A, A -○ B, C├ B★C (A -○ B)★C, A├ B★C (A -○ B)★C├ A -○ B★C ├ (A -○ B)★C -○ A -○ B★C
  • 18. Example 2 (A -○ B)∩(A -○ C) -○ A -○ B∩C (A -○ B)∩(A -○ C)├ (A -○ B)∩(A -○ C) (A -○ B)∩(A -○ C)├ (A -○ B)∩(A -○ C) (A -○ B)∩(A -○ C)├ A -○ B A├ A (A -○ B)∩(A -○ C)├ A -○ C A├ A (A -○ B)∩(A -○ C), A├ B (A -○ B)∩(A -○ C), A├ C (A -○ B)∩(A -○ C), A├ B∩C (A -○ B)∩(A -○ C)├ A -○ B∩C ├ (A -○ B)∩(A -○ C) -○ A -○ B∩C
  • 19. OR  Context-free  A+B  OR is hard to describe in natural deduction, like contextual implication.  Dual operator of ★.  ~(A★B) = ~A+~B  ~A = A -○ 0  Contextual  A∪B  Dual operator of ∩.  ~(A∩B) = ~A∪~B Γ├ A Γ├ A∪B Γ├ A∪B A, Δ├ C B, Δ├ C Γ, Δ├ C
  • 20. Example (C -○ A)∪(C -○ B) -○ C -○ A∪B C -○ A├ C -○ A C├ C C -○ B├ C -○ B C├ C C -○ A, C├ A C -○ B, C├ B (C -○ A)∪(C -○ B)├ (C -○ A)∪(C -○ B) C -○ A, C├ A∪B C -○ B, C├ A∪B (C -○ A)∪(C -○ B), C├ A∪B (C -○ A)∪(C -○ B)├ C -○ A∪B ├ (C -○ A)∪(C -○ B) -○ C -○ A∪B
  • 21. Special Operator : Storage !A  A storage formula !A denotes any number of formula A. Γ├ !B Δ, !B, !B├ A Γ├ !B Δ├ A Γ, Δ├ A Γ, Δ├ A Γ├ !B Δ, B├ A !Γ├ B Γ, Δ├ A !Γ├ !B  !Γ means that all hypotheses in Γ are storage formulae.
  • 22. Example (A -○ B -○ C) -○ (A -○ B) -○ !A -○ C A -○ B -○ C├ A -○ B -○ C A├ A A -○ B├ A -○ B A├ A !A├ !A A -○ B -○ C, A├ B -○ C !A├ !A A -○ B, A├ B A -○ B -○ C, !A├ B -○ C A -○ B, !A├ B !A├ !A A -○ B -○ C, A -○ B, !A, !A├ C A -○ B -○ C, A -○ B, !A├ C A -○ B -○ C, A -○ B├ !A -○ C A -○ B -○ C├ (A -○ B) -○ !A -○ C ├ (A -○ B -○ C) -○ (A -○ B) -○ !A -○ C
  • 23. Computations  Typed Lambda Calculus  Linear Lisp Machine
  • 24. Curry-Howard Isomorphism  Relationship between typed lambda terms and logical formulae.  typing rule  derivation rule (axiom)  typed lambda term  proof  Here, we use intuitional linear logic, which does not have double negation elimination rule.
  • 25. Linear Lambda Terms Γ, x : A├ t : B Γ├ λxA. t : A -○ B Γ├ s : A -○ B Δ├ t : A Γ, Δ├ (s t) : B ...Other rules are omitted. (They are same forms as formulae.)
  • 26. Example 1  λfA-○B. λgB-○C. λaA. (g (f a)) : (A -○ B) -○ (B -○ C) -○ A -○ C  λs(A-○B)★C.λaA.let (xA-○B★yC)=s in (x a)★y : (A -○ B)★C -○ A -○ B★C  λs(A-○B)∩(A-○C).λaA.((π0 s) a)∩((π1 s) a) : (A -○ B)∩(A -○ C) -○ A -○ B∩C  λs(C-○A)∪(C-○B).λcC. match s with | fC-○A=>(κ0 (f c)) | gC-○B=>(κ1 (g c)). : (C -○ A)∪(C -○ B) -○ C -○ A∪B
  • 27. Example 2  λfA-○B-○C.λgA-○B.λx!A.let (s!A,t!A)=copy(x) in (let aA = load(s) in (f a) let bA = load(t) in (g b)) : (A -○ B -○ C) -○ (A -○ B) -○ !A -○ C  λfA-○B-○C.λgA-○B.λx!A.let (s!A,t!A)=copy(x) in let aA = load(s) in let bA = load(t) in ((f a) (g b)) : (A -○ B -○ C) -○ (A -○ B) -○ !A -○ C  ...etc
  • 28. Linear Lisp  Lively Linear Lisp – ‘Look Ma, No Garbage!’  Henry G. Baker  Nimble Computer Corporation  ACM SIGPLAN Notices 27, 8(Aug. 1992), 89-98.
  • 29. Linear Lisp (Machine)  Linear Lisp has  nil, cons cells and symbols.  11 (atomic) operations.  And some logical function.  Linear Lisp does not require garbage collection.  Linear Lisp is not based on linear logic...  Only “NO DATA SHARING IN PROGRAMS”.
  • 30. Operations (1/3)  rn : n-th register (variable)  (<-> r1 r2)  swap r1, r2  (<-> r1 (CAR r2))  (<-> r1 (CDR r2))  r1 and r2 must be distinct, and r2 must not be ATOM (neither nil nor symbol).
  • 31. Operations (2/3)  (NULL r1)  Predicate for (= r1 NIL)  (ATOM r1)  Predicate for (or (= r1 NIL) (symbol? r1))  (EQ r1 r2)  Precondition : (and (ATOM r1) (ATOM r2))  (:= r1 ‘foo)  Precondition : (ATOM r1)
  • 32. Operations (3/3)  (:= r1 r2)  Precondition : (and (ATOM r1) (ATOM r2))  (CONS r1 r2)  r2 becomes (cons r1 r2), and r1 becomes nil.  (PUSH r1 r2)  Same as CONS  (POP r1 r2)  Precondition :(and (NULL r1) (not (ATOM r2)))  r2 becomes (cdr r2), and r1 becomes (car r2).
  • 33. Proposition  Reference counts of all cons cell in linear lisp programs are 1.  Cons cells are created when CONS (or PUSH) operations are executed, and destroyed when POP operations are executed.  So if one cons cell is not accessible, then it is destroyed soon.
  • 34. CAUTION!  Previous proposition is not one on the paper.  In the paper, auther uses “free register”, which is infinite long list and elements of the list are all nil.  Reference counts of all lists are always identically 1.  All cons cells are always accessible – i.e. live.  No garbage is created.  The name of the paper would be based on these propositions.
  • 35. Other operations  We can construct some operations with above operations.  (FREE r1)  r1 becomes nil.  (COPY r1 r2)  If r2 is nil, r2 becomes the same as r1.  Not sharing cell.  (EQUAL r1 r2)  Recursive list equality.
  • 36. FREE (FREE r1) : (if (not (NULL r1) (if (ATOM r1) (:= r1 ‘nil) (progn (PUSH r2 sp) (POP r2 r1) (FREE r1) (<-> r2 r1) (FREE r1) (POP r2 sp))))
  • 37. COPY (COPY r1 r2) : ; r2 = ‘nil (if (not (NULL r1)) (if (ATOM r1) (:= r2 r1) (progn (PUSH t1 sp) (PUSH t2 sp) (POP t1 r1) (COPY r1 r2) (<-> t1 r1) (<-> t2 r2) (COPY r1 r2) (<-> t1 r1) (<-> t2 r2) (PUSH t1 r1) (PUSH t2 r2) (POP t2 sp) (POP t1 sp))))
  • 38. EQUAL (EQUAL r1 r2) : (or (and (ATOM r1) (ATOM r2) (EQ r1 r2)) (and (not (ATOM r1)) (not (ATOM r2)) (progn (PUSH t1 sp) (PUSH t2 sp) (POP t1 r1) (POP t2 r2) (prog1 (and (EQUAL r1 r2) (progn (<-> t1 r1) (<-> t2 r2) (prog1 (EQUAL r1 r2) (<-> t1 r1) (<-> t2 r2)))) (PUSH t1 r1) (PUSH t2 r2) (POP t2 sp) (POP t1 sp)))))
  • 39. Traditional Lisp Interpreter  Auther says that we can program a traditional lisp interpreter, but there is no such a program in the paper.  Instead of it, there is a metacircular linear lisp interpreter.  It needs quote, back-quote, and macros...  The interpreter is inefficient, due to the extra expense of copying.
  • 40. And ...  The rest of paper is about how to use linear lisp in multiprocessing...  But I don’t want to talk about that.  So, that’s all for my talk.