KTUGFaq

KTUG FAQ

α:
йȣ:
Courage is your greatest present need.
PerlTeXWinEdt��ġ&value=Yhchoe/FindPageWinEdt/�������&value=Yhchoelikesam占쏙옙占쏙옙占 › LambdaCalculusInTeX
DeleteMe ߰ ˴ϴ. --

1 Logic
1.1 ڵ
1.2 ǹ
2 Ʈ

  • List in TeX's Mouth, Alan Jeffrey
  • THE COMPUTER SCIENCE OF TeX AND LaTeX, Victor Eijkhout

[]

1 Logic

[]

1.1 ڵ

ũκ Ѵ.
\def\Ignore#1{}
\def\Identity#1{#1}
\def\First#1#2{#1}
\def\Second#1#2{#2}
Taking first argument:
  input : \First {first}{second}
  output : first
Taking second argument:
  input : \Second {first}{second}
  output : second
Ѵ.
\let\True=\First
\let\False=\Second
Ǵζ, (\True) ΰ ù° ̰, (\False) ι° ̴. ̰ ǹ̰ , ΰ ڴ T F ̾ Ѵ. \True \False ϴ ǹ̴ .
input : \True TF
output: T

input : \False TF
output: F
ΰ TF ִ Ѵ.

ڵ Ѵ.
\def\And#1#2{#1{#2}\False}
\def\Or#1#2{#1\True{#2}}
\def\Twiddle#1#2#3{#1{#3}{#2}}
\let\Not=\Twiddle
: \And x y x ̸, y ̰, x ̸, y ̴. ù° ڸ ι° ڸ Ѵٴ Ϳ ϸ \And Ǵ ̰, \Or ̴.

ڵ ׽Ʈ غ.
True takes first of TF:
  input : \True TF
  output : T
False takes second of TF:
  input : \False TF
  output : F
Not true is false:
  input : \Not \True TF
  output : F
And truth table TrueTrue:
  input : \And \True \True TF
  output : T
And truth table TrueFalse:
  input : \And \True \False TF
  output : F
And truth table FalseTrue:
  input : \And \False \True TF
  output : F
And truth table FalseFalse:
  input : \And \False \False TF
  output : F
Or truth table TrueTrue:
  input : \Or \True \True TF
  output : T
Or truth table TrueFalse:
  input : \Or \True \False TF
  output : T
Or truth table FalseTrue:
  input : \Or \False \True TF
  output : T
Or truth table FalseFalse:
  input : \Or \False \False TF
  output : F
)
  • \And \True \False TF, \AND Ǵ ϸ,
    \And \True \False TF 
    ==> \True{\False}\False TF
    ==> \False TF
    ==> F
    
  • \Not \True TF, \NOT Ǵ ϸ,
    \Not \True TF
    ==> \True{F}{T}
    ==> F
    


[]

1.2 ǹ

⺻ ũε Ѵ.
\def\gobblefalse\else\gobbletrue\fi#1#2{\fi#1}
\def\gobbletrue\fi#1#2{\fi#2}
\def\TeXIf#1#2{#1#2 \gobblefalse\else\gobbletrue\fi}
\TeXIf <test> <arg>
׽Ʈ Ѵ:
\def\IfIsPositive{\TeXIf{\ifnum0<}}

Numerical test:
  input : \IfIsPositive {3} TF
  output : T
Numerical test:
  input : \IfIsPositive {-2} TF
  output : F
)
  • \IfIsPositive { 3 } TF Ǵ ϸ,
    \IfIsPositive {3} TF
    ==> \TeXIf{\ifnum0<}{3}TF
    ==> \ifnum0<3\gobblefalse\else\gobbletrue\fi TF
    ==> \ifnum0<3\fi T
    ==> T
    
[]

2 Ʈ

Ʈ Ӹ(head) (tail) Ǵµ, Ӹ (element) ̰, Ǵٸ Ʈ̴. Ʈ ǰ ̴. Ʈ(empty list) Nil ǥѴ.
\let\Nil=\False
Ʈ Ǹ ΰ ڸ ڷ Ѵ:
  • Ʈ ʴٸ, ù° ڴ Ӹ ǰ, Ʈ ȴ.
  • Ʈ ִٸ, ι° ڰ Ʈ ȴ.

    \[ La_1a_2 = \left\{ \begin{array}{ll}
                      a_2     & \mbox{if $L=()$} \\
                      a_1(x)Y & \mbox{if $L=(x,Y)$}
                    \end{array}
             \right. \]


DeleteMe. ̸ ٲپϴ.

^
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2006-05-15 19:06:39
Processing time 0.0454 sec