KTUGFaq
KTUG FAQ
占쏙옙占쏙옙占쌕띰옙占쏙옙占쏙옙占쏙옙占 › TeXmacs › 2008-03 › TeX&value=Yhchoe/FindPage › ScriptLanguages › LambdaCalculusInTeX
DeleteMe ߰ ˴ϴ. --
1.1 ڵ ¶
ũκ Ѵ.
Ǵζ, (\True) ΰ ù° ̰, (\False) ι° ̴. ̰ ǹ̰ , ΰ ڴ T F ̾ Ѵ. \True \False ϴ ǹ̴ .
ΰ TF ִ Ѵ.
\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
input : \True TF output: T input : \False TF output: F
ڵ Ѵ.
: \And x y x ̸, y ̰, x ̸, y ̴.
ù° ڸ ι° ڸ Ѵٴ Ϳ ϸ \And Ǵ ̰, \Or ̴.
\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
ڵ Ʈ غ.
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