Кіріспе
Математикалық логикадағы формальды жүйе. Ламбда-калькулының қарапайым типі, тип теориясының бір түрі, функциялық типтерді құратын жалғыз типтік конструктормен ламбда-калькулының типтелген түсіндірмесі болып табылады. Бұл типтелген ламбда-калькулының канондық және ең қарапайым мысалы. Ламбда-калькулы 1940 жылы Алонзо Черч тарапынан типтелмеген ламбда-калькулының парадоксалды қолданылуын болдырмау мақсатымен енгізілген. Оның ламбда-калькулы, символдық өрнектерге негізделген формальды тіл ретінде, санауға келмейтін аксиомалар мен айнымалылардың тізбегінен, сондай-ақ примитивті символдардың шекті жиынтығынан және I-ден VI-ға дейінгі ережелердің шекті жиынтығынан тұрады. Бұл шекті ережелер жиынтығына V-ереже (modus ponens), сондай-ақ тиісінше IV және VI ережелері кірді. (1) (2) (3) (4)
The simply typed lambda calculus , a form
of type theory, is a typed interpretation of the lambda calculus with only one type constructor that builds function types. It is the canonical and simplest example of a typed lambda calculus. The simply typed lambda calculus was originally introduced by Alonzo Church in 1940 as an attempt to avoid paradoxical use of the untyped lambda calculus. his lambda calculus, as a formal language based on symbolic expressions, consisted of a denumerably infinite series of axioms and variables, but also a finite set of primitive symbols, and also, a finite set of rules I to VI. This finite set of rules included rule V modus ponens as well as IV and VI for substitution and generalization respectively. (1) (2) (3) (4)
In words,
If has type in the context, then has type Term constants have the appropriate base types. If, in a certain context with having type , has type , then, in the same context without , has type If, in a certain context, has type , and has type , then has type
Examples of closed terms, i. e. terms typable in the empty context, are:
For every type , a term (identity function/I combinator),
For types , a term (the K combinator), and
For types , a term (the S combinator). These are the typed lambda calculus representations of the basic combinators of combinatory logic. Each type is assigned an order, a number For base types, ; for function types, That is, the order of a type measures the depth of the most left nested arrow. Hence:
Сөздермен айтқанда, егер белгілі бір контексте түрі болса, онда түрі бар. Терминдік тұрақтылардың тиісті базалық түрлері болады. Егер белгілі бір контексте түрі бар , түрі бар болса, онда сол контексте түрі жоқ , түрі бар. Егер белгілі бір контексте түрі бар , түрі бар болса, онда түрі бар.
The simply typed lambda calculus , a form
of type theory, is a typed interpretation of the lambda calculus with only one type constructor that builds function types. It is the canonical and simplest example of a typed lambda calculus. The simply typed lambda calculus was originally introduced by Alonzo Church in 1940 as an attempt to avoid paradoxical use of the untyped lambda calculus. his lambda calculus, as a formal language based on symbolic expressions, consisted of a denumerably infinite series of axioms and variables, but also a finite set of primitive symbols, and also, a finite set of rules I to VI. This finite set of rules included rule V modus ponens as well as IV and VI for substitution and generalization respectively. (1) (2) (3) (4)
In words,
If has type in the context, then has type Term constants have the appropriate base types. If, in a certain context with having type , has type , then, in the same context without , has type If, in a certain context, has type , and has type , then has type
Examples of closed terms, i. e. terms typable in the empty context, are:
For every type , a term (identity function/I combinator),
For types , a term (the K combinator), and
For types , a term (the S combinator). These are the typed lambda calculus representations of the basic combinators of combinatory logic. Each type is assigned an order, a number For base types, ; for function types, That is, the order of a type measures the depth of the most left nested arrow. Hence:
Жабық терминдердің мысалдары, яғни бос контексте типтелуге болатын терминдер:
The simply typed lambda calculus , a form
of type theory, is a typed interpretation of the lambda calculus with only one type constructor that builds function types. It is the canonical and simplest example of a typed lambda calculus. The simply typed lambda calculus was originally introduced by Alonzo Church in 1940 as an attempt to avoid paradoxical use of the untyped lambda calculus. his lambda calculus, as a formal language based on symbolic expressions, consisted of a denumerably infinite series of axioms and variables, but also a finite set of primitive symbols, and also, a finite set of rules I to VI. This finite set of rules included rule V modus ponens as well as IV and VI for substitution and generalization respectively. (1) (2) (3) (4)
In words,
If has type in the context, then has type Term constants have the appropriate base types. If, in a certain context with having type , has type , then, in the same context without , has type If, in a certain context, has type , and has type , then has type
Examples of closed terms, i. e. terms typable in the empty context, are:
For every type , a term (identity function/I combinator),
For types , a term (the K combinator), and
For types , a term (the S combinator). These are the typed lambda calculus representations of the basic combinators of combinatory logic. Each type is assigned an order, a number For base types, ; for function types, That is, the order of a type measures the depth of the most left nested arrow. Hence:
Кез келген тип үшін термин (ідентикалық функция / I комбинаторы),
, типтері үшін термин (K комбинаторы), және
, типтері үшін термин (S комбинаторы). Бұл комбинаторлық логиканың негізгі комбинаторларының типтелген ламбда-калькулындағы бейнелері. Әр типке дәреже беріледі, сан; базалық типтер үшін, функциялық типтер үшін. Яғни, типтің дәрежесі ең сол жаққа орналасқан жебенің тереңдігін өлшейді. Сондықтан:
The simply typed lambda calculus , a form
of type theory, is a typed interpretation of the lambda calculus with only one type constructor that builds function types. It is the canonical and simplest example of a typed lambda calculus. The simply typed lambda calculus was originally introduced by Alonzo Church in 1940 as an attempt to avoid paradoxical use of the untyped lambda calculus. his lambda calculus, as a formal language based on symbolic expressions, consisted of a denumerably infinite series of axioms and variables, but also a finite set of primitive symbols, and also, a finite set of rules I to VI. This finite set of rules included rule V modus ponens as well as IV and VI for substitution and generalization respectively. (1) (2) (3) (4)
In words,
If has type in the context, then has type Term constants have the appropriate base types. If, in a certain context with having type , has type , then, in the same context without , has type If, in a certain context, has type , and has type , then has type
Examples of closed terms, i. e. terms typable in the empty context, are:
For every type , a term (identity function/I combinator),
For types , a term (the K combinator), and
For types , a term (the S combinator). These are the typed lambda calculus representations of the basic combinators of combinatory logic. Each type is assigned an order, a number For base types, ; for function types, That is, the order of a type measures the depth of the most left nested arrow. Hence:
Ішкі және сыртқы түсіндірмелер
Жалпы алғанда, жай типтелген лямбда-калькулюсқа, және жалпы түрде типтелген тілдерге мағына берудің екі әртүрлі тәсілі бар, олар ішкі және сыртқы, онтологиялық және семантикалық, немесе Чёрч стилі мен Карри стилі деп аталады. Ішкі семантика тек жақсы типтелген терминдерге ғана мағына тағайындайды, немесе дәлірек айтқанда, типтеу туындыларына тікелей мағына тағайындайды. Бұл терминдердің тек типтік белгілемелермен ғана ерекшеленетініне қарамастан, әртүрлі мағыналарға ие болуы мүмкін дегенді білдіреді. Мысалы, бүтін сандардағы сәйкестік термині мен бульдіктердегі сәйкестік термині әртүрлі нәрсені білдіруі мүмкін. (Классикалық түсіндірмелер – бүтін сандардағы сәйкестік функциясы және бульдік мәндердегі сәйкестік функциясы.) Керісінше, сыртқы семантика терминдерге типтеуге қарамастан мағына тағайындайды, олар типтелмеген тілде түсіндірілгендей. Осы көзқарас бойынша, және бірдей мағына береді (яғни, бірдей). Ішкі және сыртқы семантика арасындағы айырмашылық кейде лямбда абстракцияларындағы белгілемелердің болуымен немесе болмауымен байланысты, бірақ қатаң айтқанда бұл қолдану дәл емес. Түрлерді елемеу арқылы (яғни, түрді жою арқылы) белгіленген терминдер үшін сыртқы семантиканы анықтауға болады, ал типтер контекстен шығарыла алатын жағдайда (яғни, типтік қорытынды арқылы) белгіленбеген терминдер үшін ішкі семантиканы беруге болады. Ішкі және сыртқы тәсілдер арасындағы негізгі айырмашылық – типтеу ережелері тілді анықтау ретінде қарастырыла ма, әлде бастапқы негізгі тілдің қасиеттерін тексеру үшін формализм ретінде қарастырыла ма. Төменде талқыланатын көптеген семантикалық түсіндірмелерді ішкі немесе сыртқы перспективадан қарастыруға болады.
are the identity function on integers and the identity function on boolean values.) In contrast, an extrinsic semantics assigns meaning to terms regardless of typing, as they would be interpreted in an untyped language. In this view, and mean the same thing (i. e., the same thing as ). The distinction between intrinsic and extrinsic semantics is sometimes associated with the presence or absence of annotations on lambda abstractions, but strictly speaking this usage is imprecise. It is possible to define an extrinsic semantics on annotated terms simply by ignoring the types (i. e., through type erasure), as it is possible to give an intrinsic semantics on unannotated terms when the types can be deduced from context (i. e., through type inference). The essential difference between intrinsic and extrinsic approaches is just whether the typing rules are viewed as defining the language, or as a formalism for verifying properties of a more primitive underlying language. Most of the different semantic interpretations discussed below can be seen through either an intrinsic or extrinsic perspective.
Операциялық семантика
Сол сияқты, жай типтелген лямбда-калькустың операциялық семантикасы, типтелмеген лямбда-калькустың семантикасы сияқты, атау бойынша шақыру, мән бойынша шақыру немесе басқа бағалау стратегияларын қолдану арқылы анықталуы мүмкін. Кез келген типтелген тіл үшін, типтік қауіпсіздік – мұндай бағалау стратегияларының барлық негізгі қасиеті болып табылады. Бұған қоса, төменде сипатталған күшті нормалдану қасиеті, кез келген бағалау стратегиясы барлық жай типтелген терминдер үшін аяқталады дегенді білдіреді. Бергер мен Швихтенберг 1991 жылы таза семантикалық нормалдануды дәлелдеді (бағалау арқылы нормалдану қараңыз). Біз табиғи сандарды (Church сандары) түрінің терминдері арқылы кодтай аламыз. 1975 жылы Швихтенберг кеңейтілген көпмүшелер Church сандарының функциялары ретінде бейнелене алатынын көрсетті.