Kappa calculus

In mathematical logic, category theory, and computer science, kappa calculus is a formal system for defining first-order functions.

Unlike lambda calculus, kappa calculus has no higher-order functions; its functions are not first class objects. Kappa-calculus can be regarded as "a reformulation of the first-order fragment of typed lambda calculus".[1]

Because its functions are not first-class objects, evaluation of kappa calculus expressions does not require closures.

Definition

The definition below has been adapted from the diagrams on pages 205 and 207 of Hasegawa.[1]

Grammar

Kappa calculus consists of types and expressions, given by the grammar below:

In other words,

  • 1 is a type
  • If and are types then is a type.
  • Every variable is an expression
  • If τ is a type then is an expression
  • If τ is a type then is an expression
  • If τ is a type and e is an expression then is an expression
  • If and are expressions then is an expression
  • If x is a variable, τ is a type, and e is an expression, then is an expression

The and the subscripts of id, !, and are sometimes omitted when they can be unambiguously determined from the context.

Juxtaposition is often used as an abbreviation for a combination of and composition:

Typing rules

The presentation here uses sequents () rather than hypothetical judgments in order to ease comparison with the simply typed lambda calculus. This requires the additional Var rule, which does not appear in Hasegawa[1]

In kappa calculus an expression has two types: the type of its source and the type of its target. The notation is used to indicate that expression e has source type and target type .

Expressions in kappa calculus are assigned types according to the following rules:

(Var)
(Id)
(Bang)
(Comp)
(Lift)
(Kappa)

In other words,

  • Var: assuming lets you conclude that
  • Id: for any type τ,
  • Bang: for any type τ,
  • Comp: if the target type of matches the source type of they may be composed to form an expression with the source type of and target type of
  • Lift: if , then
  • Kappa: if we can conclude that under the assumption that , then we may conclude without that assumption that

Equalities

Kappa calculus obeys the following equalities:

  • Neutrality: If then and
  • Associativity: If , , and , then .
  • Terminality: If and then
  • Lift-Reduction:
  • Kappa-Reduction: if x is not free in h

The last two equalities are reduction rules for the calculus, rewriting from left to right.

Properties

The type 1 can be regarded as the unit type. Because of this, any two functions whose argument type is the same and whose result type is 1 should be equal – since there is only a single value of type 1 both functions must return that value for every argument (Terminality).

Expressions with type can be regarded as "constants" or values of "ground type"; this is because 1 is the unit type, and so a function from this type is necessarily a constant function. Note that the kappa rule allows abstractions only when the variable being abstracted has the type for some τ. This is the basic mechanism which ensures that all functions are first-order.

Categorical semantics

Kappa calculus is intended to be the internal language of contextually complete categories.

Examples

Expressions with multiple arguments have source types which are "right-imbalanced" binary trees. For example, a function f with three arguments of types A, B, and C and result type D will have type

If we define left-associative juxtaposition as an abbreviation for , then – assuming that , , and – we can apply this function:

Since the expression has source type 1, it is a "ground value" and may be passed as an argument to another function. If , then

Much like a curried function of type in lambda calculus, partial application is possible:

However no higher types (i.e. ) are involved. Note that because the source type of f a is not 1, the following expression cannot be well-typed under the assumptions mentioned so far:

Because successive application is used for multiple arguments it is not necessary to know the arity of a function in order to determine its typing; for example, if we know that then the expression

j c

is well-typed as long as j has type

for some α

and β. This property is important when calculating the principal type of an expression, something which can be difficult when attempting to exclude higher-order functions from typed lambda calculi by restricting the grammar of types.

History

Barendregt originally introduced[2] the term "functional completeness" in the context of combinatory algebra. Kappa calculus arose out of efforts by Lambek[3] to formulate an appropriate analogue of functional completeness for arbitrary categories (see Hermida and Jacobs,[4] section 1). Hasegawa later developed kappa calculus into a usable (though simple) programming language including arithmetic over natural numbers and primitive recursion.[1] Connections to arrows were later investigated[5] by Power, Thielecke, and others.

Variants

It is possible to explore versions of kappa calculus with substructural types such as linear, affine, and ordered types. These extensions require eliminating or restricting the expression. In such circumstances the × type operator is not a true cartesian product, and is generally written to make this clear.

References

  1. ^ a b c d Hasegawa, Masahito (1995). "Decomposing typed lambda calculus into a couple of categorical programming languages". In Pitt, David; Rydeheard, David E.; Johnstone, Peter (eds.). Category Theory and Computer Science. Lecture Notes in Computer Science. Vol. 953. Springer-Verlag Berlin Heidelberg. pp. 200–219. CiteSeerX 10.1.1.53.715. doi:10.1007/3-540-60164-3_28. ISBN 978-3-540-60164-7. ISSN 0302-9743.
  2. ^ Barendregt, Hendrik Pieter, ed. (October 1, 1984). The Lambda Calculus: Its Syntax and Semantics. Studies in Logic and the Foundations of Mathematics. Vol. 103 (Revised ed.). Amsterdam, North Holland: Elsevier Science. ISBN 978-0-444-87508-2.
  3. ^ Lambek, Joachim (August 1, 1973). "Functional completeness of cartesian categories". Annals of Mathematical Logic. 6 (3–4) (published March 1974): 259–292. doi:10.1016/0003-4843(74)90003-5. ISSN 0003-4843.
  4. ^ Hermida, Claudio; Jacobs, Bart (December 1995). "Fibrations with indeterminates: contextual and functional completeness for polymorphic lambda calculi". Mathematical Structures in Computer Science. 5 (4): 501–531. doi:10.1017/S0960129500001213. ISSN 1469-8072. S2CID 3428512.
  5. ^ Power, John; Thielecke, Hayo (1999). "Closed Freyd- and κ-categories". In Wiedermann, Jiří; van Emde Boas, Peter; Nielsen, Mogens (eds.). Automata, Languages and Programming. Lecture Notes in Computer Science. Vol. 1644. Springer-Verlag Berlin Heidelberg. pp. 625–634. CiteSeerX 10.1.1.42.2151. doi:10.1007/3-540-48523-6_59. ISBN 978-3-540-66224-2. ISSN 0302-9743.

Read other articles:

Chiaki MukaiKebangsaanJepangPekerjaanDokterKarier luar angkasaAntariksawan NASDA/JAXAWaktu di luar angkasa23 hari 15 jam 39 menitSeleksiGrup NASDA 1985MisiSTS-65, STS-95Lambang misi Chiaki Mukai, M.D., Ph.D. (向井千秋code: ja is deprecated , Mukai Chiaki, lahir 6 Mei 1952) adalah antariksawan NASDA sekaligus astronaut wanita pertama Jepang. Ia adalah dokter spesialis bedah lulusan Universitas Keio. Pendidikan Chiaki Mukai dilahirkan sebagai Chiaki Naito (内藤千秋code: ja is deprecate...

 

Artikel atau sebagian dari artikel ini mungkin diterjemahkan dari List of World Heritage Sites in Serbia di en.wikipedia.org. Isinya masih belum akurat, karena bagian yang diterjemahkan masih perlu diperhalus dan disempurnakan. Jika Anda menguasai bahasa aslinya, harap pertimbangkan untuk menelusuri referensinya dan menyempurnakan terjemahan ini. Anda juga dapat ikut bergotong royong pada ProyekWiki Perbaikan Terjemahan. (Pesan ini dapat dihapus jika terjemahan dirasa sudah cukup tepat. Lihat...

 

United States historic placeJohn Turn FarmU.S. National Register of Historic Places John Turn Farm barn, HABS photo, 1970Show map of PennsylvaniaShow map of the United StatesLocationNortheast of Stroudsburg, Middle Smithfield Township, PennsylvaniaCoordinates41°3′30″N 75°1′25″W / 41.05833°N 75.02361°W / 41.05833; -75.02361Area6 acres (2.4 ha)Built byTurn, John, Sr.NRHP reference No.79000249[1]Added to NRHPJuly 23, 1979 John Turn Farm...

Untuk kegunaan lain, lihat Dunia (disambiguasi). Kelereng Biru Bumi. Dunia, buana, jagat, atau rat adalah nama umum yang digunakan untuk menyebut keseluruhan peradaban manusia, pengalaman manusia, sejarah manusia, atau keadaan manusia secara umum di seluruh Bumi,[1] atau mengenai segala sesuatu yang terdapat di dalamnya. Dalam konteks filosofi, dunia bisa merujuk pada keseluruhan fisik alam semesta, atau sebuah konsep ontologi. Dalam konteks teologi, dunia biasanya mengacu pada materi...

 

Chemical compound SSR-180,711Identifiers IUPAC name (4-bromophenyl) 1,4-diazabicyclo[3.2.2]nonane-4-carboxylate CAS Number298198-52-4 YPubChem CID9928899ChemSpider7973126UNIIQF4P1U1666Chemical and physical dataFormulaC14H21BrN2O2Molar mass329.238 g·mol−13D model (JSmol)Interactive image SMILES c1cc(ccc1OC(=O)N2CCN3CCC2CC3)Br InChI InChI=1S/C14H17BrN2O2/c15-11-1-3-13(4-2-11)19-14(18)17-10-9-16-7-5-12(17)6-8-16/h1-4,12H,5-10H2Key:RXLOZRCLQMJJLC-UHFFFAOYSA-N   (verify) SSR...

 

Kris WuWu pada tahun 2017Nama asal吴亦凡LahirLi Jiaheng (李嘉恒)6 November 1990 (umur 33)Guangzhou, TiongkokKebangsaanKanadaNama lainWu Yi FanAlmamaterSir Winston Churchill Secondary SchoolPekerjaanPenyanyipenulis laguaktormodelTahun aktif2012–sekarangKarier musikAsalSeoul, Korea SelatanGenreHip hopR&BInstrumenVokalLabelAce Unit CultureInterscopeUniversal Music ChinaGo EastSMArtis terkaitExoExo-MSM Town Kris Wu Li Jiaheng Hanzi sederhana: 李嘉恒 Hanzi tradi...

Sulawesi Selatan IIIDaerah Pemilihan / Daerah pemilihanuntuk Dewan Perwakilan RakyatRepublik IndonesiaWilayah Daftar Kabupaten : Enrekang Luwu Luwu Timur Luwu Utara Pinrang Sidenreng Rappang Tana Toraja Toraja Utara Kota : Palopo ProvinsiSulawesi SelatanPopulasi2.679.554 (2023)[1]Elektorat1.920.090 (2024)[2]Daerah pemilihan saat iniDibentuk2009Kursi7Anggota  La Tinro La Tunrung (Gerindra)  Sarce Bandaso Tandiasik (PDI-P)  Muhammad Fauzi (Golkar)  ...

 

Swiss road cyclist Michael SchärSchär at the 2012 Critérium du DauphinéPersonal informationFull nameMichael SchärBorn (1986-09-29) 29 September 1986 (age 37)Geuensee, Lucerne, SwitzerlandHeight1.98 m (6 ft 6 in)Weight78 kg (172 lb; 12 st 4 lb)Team informationCurrent teamLidl–TrekDisciplineRoadRoleRider (retired)Directeur sportifRider typeDomestiqueAmateur team2006Hadimec Professional teams2006Phonak2007–2009Astana2010–2020BMC R...

 

История Грузииსაქართველოს ისტორია Доисторическая Грузия Шулавери-шомутепинская культураКуро-араксская культураТриалетская культураКолхидская культураКобанская культураДиаухиМушки Древняя история КолхидаАриан-КартлиИберийское царство ФарнавазидыГруз�...

Halaman ini memuat daftar paroki di Keuskupan Agung Palembang. Daftar ini tidak dimaksudkan sebagai suatu daftar yang lengkap atau selalu terbarui. Jika Anda melihat artikel yang seharusnya tercantum di sini, silakan sunting halaman ini dan tambahkan pranala ke artikel tersebut. Gunakan perubahan terkait untuk melihat perubahan terbaru dari artikel-artikel yang tercantum pada halaman ini.[1] Daftar Dekanat I Gambar Paroki Pelindung Lokasi Stasi/Kapel Paroki Katedral Palembang Santa Ma...

 

Suku Dayak MeratusDaerah dengan populasi signifikanKalimantan Selatan: 35.838 (BPS - sensus th. 2000) Kalimantan TimurBahasaMeratus, Banjar, IndonesiaAgama • Kaharingan, Kristen dan KatolikKelompok etnik terkaitDayak Ngaju, Banjar Litografi berjudul Orang-Boekit uit de Afdeeling Amoentai en Dajaksche vrouw uit Longwai (Orang Bukit dari afdeeling Amuntai dan wanita Dayak Modang dari Long Wai) berdasarkan gambar oleh Carl Bock (1887) Suku Dayak Meratus adalah nama kolektif untuk sekumpu...

 

Class of polyethylenes HDPE has SPI resin ID code 2 High-density polyethylene (HDPE) or polyethylene high-density (PEHD) is a thermoplastic polymer produced from the monomer ethylene. It is sometimes called alkathene or polythene when used for HDPE pipes.[1] With a high strength-to-density ratio, HDPE is used in the production of plastic bottles, corrosion-resistant piping, geomembranes and plastic lumber. HDPE is commonly recycled, and has the number 2 as its resin identification cod...

Chief queen consort of Burma Hanthawaddy Mibaya ဟံသာဝတီ မိဖုရားChief queen consort of BurmaTenure10 November 1581 – 19 December [O.S. 9 December] 1599PredecessorSanda DewiSuccessorThiri Maha Dhamma Yaza Dipadi DewiBornc. 1536 c. 898 METoungoo (Taungoo)DiedJune 1606 1st Waso 968 METoungooSpouseNanda BayinIssue1. Thakin Gyi[1] 2. Min Htwe (daughter) 3. Mingyi Swa 4. Khin Ma Hnaung (daughter) 5. Khin Pu (daughter) 6. Minye Kyawswa II 7. Tha...

 

Former Spanish colony in the Caribbean Spanish SantiagoSantiago1509–1655 FlagStatusColony of Spain; part of the Spanish West Indies, Captaincy General of Santo DomingoCapitalVilla de la VegaCommon languagesSpanishTaínoGovernment• King of Spain Ferdinand II of Aragon (First) Charles II of Spain (Last) Governor • 1510–1514 Juan de Esquivel (First)• 1656–1660 Cristóbal Arnaldo Isasi (Last) History • Established 1509• Disestablished 1655 C...

 

American Air Force general (born 1942) This article is about the U.S. Air Force general. For other people with the same name, see Richard Myers (disambiguation). Richard MyersGeneral Richard Myers in 2002Born (1942-03-01) 1 March 1942 (age 82)Kansas City, Missouri, United StatesAllegianceUnited StatesService/branchUnited States Air ForceYears of service1965–2005RankGeneralCommands heldChairman of the Joint Chiefs of StaffVice Chairman of the Joint Chiefs of StaffNorth American Aer...

Годы 1979 · 1980 · 1981 · 1982 — 1983 — 1984 · 1985 · 1986 · 1987 Десятилетия 1960-е · 1970-е — 1980-е — 1990-е · 2000-е Века XIX век — XX век — XXI век 2-е тысячелетие XVIII век XIX век XX век XXI век XXII век 1890-е 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900-е 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910-е 1910 1911 1912 1913 1914 1915 1916 1...

 

André FranquinNegara Belgia AreaPenulisKarya terkenal'Spirou et Fantasio Gaston Lagaffe Idées noireshttp://www.tintin.com André Franquin (3 Januari 1924 – 5 Januari 1997) adalah seorang pemberi pengaruh dan artis di bidang komik yang berkebangsaan Belgia, di mana karyanya yang terkenal adalah Gaston dan Marsupilami, yang diciptakannya ketika ia bekerja di Spirou et Fantasio komic dari tahun 1947 hingga 1969, yang mana masa-masa itu adalah masa keemasan di bidang perkom...

 

الدوري الإسكتلندي الدرجة الرابعة 2014–15 تفاصيل الموسم الدوري الإسكتلندي الدرجة الرابعة  [لغات أخرى]‏  البلد المملكة المتحدة  الدوري الإسكتلندي الدرجة الرابعة 2013–14  الدوري الإسكتلندي الدرجة الرابعة 2015–16  تعديل مصدري - تعديل   الدوري الإسكتلندي الدرجة ...

A map of the Zuidvleugel, with The Hague in the north-west and Rotterdam in the south-east. Zuidvleugel (Dutch pronunciation: [ˈzœytˌfløːɣəl], literally south wing) is the band of cities and towns located along the southern wing of the Randstad in the Netherlands. It is that part of the Randstad that is located in the Province of South Holland. This developing conurbation extends around 60 kilometres from Dordrecht to Leiden. The two main focal points are the area around Rotter...

 

Place in Upper Carniola, SloveniaMartinj VrhMartinj VrhLocation in SloveniaCoordinates: 46°11′26.88″N 14°7′58.9″E / 46.1908000°N 14.133028°E / 46.1908000; 14.133028Country SloveniaTraditional RegionUpper CarniolaStatistical regionUpper CarniolaMunicipalityŽeleznikiElevation781.3 m (2,563.3 ft)Population (2002) • Total232[1] Martinj Vrh (pronounced [maɾˈtiːɱ ˈʋəɾx]; in older sources also Sveti Martinj Vrh,&...