Polymorphic type inference and assignment

Size: px
Start display at page:

Download "Polymorphic type inference and assignment"

Transcription

1 Proc. 18th Symp. Principls of Programming Languags, 1991, pags Polymorphic typ infrnc and assignmnt Abstract Xavir Lroy Ecol Normal Supériur W prsnt a nw approach to th polymorphic typing of data accpting in-plac modification in ML-lik languags. This approach is basd on rstrictions ovr typ gnralization, and a rfind typing of functions. Th typ systm givn hr lads to a bttr intgration of imprativ programming styl with th purly applicativ krnl of ML. In particular, gnric functions that allocat mutabl data can safly b givn fully polymorphic typs. W show th soundnss of this typ systm, and giv a typ rconstruction algorithm. 1 Introduction Polymorphic typ disciplins originat in th study of λ- calculus and its connctions to constructiv logic [7, 14], so it is no surpris it fits vry nicly within purly applicativ languags, without sid ffcts. Howvr, polymorphism bcoms problmatic whn w mov toward convntional imprativ languags (Algol, Pascal), and allow physical modification of data structurs. Th problm appard at an arly stag of th dsign of ML [8, p. 52], whn assignmnt oprators wr providd for th primitiv data typs of rfrncs and vctors. Considr th following xampl, in ML 1 : lt r = rf [ ] in r := [1]; if had(!r) thn... ls... If w naivly giv typ α. α list rf to th rfrnc r, w can first us it with typ int list rf, and stor in it th list with 1 as singl lmnt an int list, indd. Givn its typ, w can also considr r as having typ bool list rf, hnc had(!r) has typ bool, and th if statmnt is wll-typd. Howvr, had(!r) valuats to 1, which is not a valid boolan. This xampl shows Authors addrss: B.P.105, L Chsnay, Franc. xlroy@margaux.inria.fr, wis@margaux.inria.fr. 1 Survival kit for th radr unfamiliar with ML: [ ] is th (polymorphic) mpty list, [a 1 ;... ; a n ] th list with lmnts a 1... a n. rf x allocats a nw rfrnc (indirction cll), initializd to x. r := x updats th contnts of rfrnc r by x.!r rturns th currnt contnts of rfrnc r. Pirr Wis INRIA Rocquncourt that physical modification of data compromiss typ safty, sinc it can invalidat static typing assumptions. As dmonstratd hr, th us of polymorphic mutabl data (that is, data structurs that can b modifid in plac) must b rstrictd. An obvious way to tackl this problm, usd in arly implmntations of ML [3], is to rquir all such data to hav monomorphic, statically-known typs. This rstriction trivially solvs th problm, but it also maks it impossibl to writ polymorphic functions that crat mutabl valus. This fact has unfortunat consquncs. A first drawback is that it is not possibl to provid gnric, fficint implmntations of most data structurs (vctors, hash tabls, graphs, B-trs,... ), as thy rquir physical modification. Evn a trivial function such as taking a vctor of an arbitrary typ and rturning a copy of it is not wll-typd with th policy abov, sinc it crats a vctor with a statically unknown typ. Anothr drawback is that polymorphic mutabl valus ar prohibitd vn if thy ar not rturnd, but usd for intrnal computation only. As a consqunc, most gnric functions cannot b writtn in an imprativ styl, with rfrncs holding intrmdiat rsults. Considr th familiar map functional: lt rc applicativ map f l = if null l thn [ ] ls f (had l) :: applicativ map f (tail l) Hr is an altrnat implmntation of map in imprativ styl: lt imprativ map f l = lt argumnt = rf l and rsult = rf [ ] in whil not (null!argumnt) do rsult := f (had!argumnt) ::!rsult; argumnt := tail!argumnt don; rvrs!rsult Som ML typ systms rjct imprativ map as illtypd. Othrs giv it a lss gnral typ than its purly applicativ vrsion. In any cas, th imprativ vrsion cannot b substitutd for th applicativ on, Pag 1

2 vn though thy hav xactly th sam smantics. As dmonstratd hr, th programming styl (imprativ vs. applicativ) intrfrs with th typ spcifications. This clarly gos against modular programming. Som nhancmnts to th ML typ systm hav bn proposd [4, 16, 17, 1], that wakn th rstrictions ovr polymorphic mutabl data. Standard ML [11] incorporats som of ths idas. Ths nhancd typ systms mak it possibl to dfin many usful gnric functions ovr mutabl data structurs, such as th function that copis a vctor. Howvr, ths systms ar still not powrful nough: thy fail to infr th most gnral typ for th imprativ map xampl abov; and thy do not work wll in conjunction with highr-ordr functions. Bcaus of ths shortcomings, Standard ML dos not provid adquat support for th imprativ programming styl. This is a major waknss for a gnral-purpos programming languag. In this papr, w prsnt a nw way to typchck mutabl data within a polymorphic typ disciplin. Our typ systm is a simpl xtnsion of th on of ML. It prmits typ rconstruction and posssss th principal typ proprty. It rquirs minimal modifications to th ML typ algbra. Yt it dfinitly improvs th support for imprativ programming in ML. It allows gnric functions ovr mutabl data structurs to hav fully polymorphic typs. It is powrful nough to assign to a function writtn in imprativ styl th sam typ as its purly applicativ countrpart. For xampl, in this systm, th imprativ implmntation of map cannot b distinguishd from th usual, applicativ on, as far as typs ar concrnd. Th rmaindr of th papr is organizd as follows. In sction 2, w introduc informally our typ systm, and show th nd for a mor prcis typchcking of functions. Sction 3 formalizs th idas abov. W stat th typchcking ruls, show thir soundnss, and giv a typ rconstruction algorithm. Sction 4 brifly compars our approach with prvious ons. W giv a fw concluding rmarks in sction 5. 2 Informal prsntation In this sction, w informally introduc our typing disciplin for mutabl data, focusing on rfrncs to b mor spcific. Unlik th Standard ML approach, w do not attmpt to dtct th cration of polymorphic rfrncs. What w prohibit is th us of a rfrnc with two diffrnt typs. Th only way to us a valu with svral typs is to gnraliz its typ first, that is, to univrsally quantify ovr som of its typ variabls. (In ML, th only construct that gnralizs typs is th lt binding.) Hnc, what w rstrict is typ gnralization: w nvr gnraliz a typ variabl that may b fr in th typ of a rfrnc. Such a typ variabl is said to b dangrous. Not gnralizing dangrous typ variabls nsurs that a mutabl valu always posssss a monotyp. It rmains to dtct dangrous typ variabls at gnralization-tim. Though this suggsts a complx and xpnsiv static analysis, this turns out not to b th cas: dangrous variabls can b dtrmind by mr xamination of th typ bing gnralizd, as w shall now illustrat. 2.1 Datatyps Considr th xampl givn in introduction: lt r = rf [ ] in r := [1]; if had(!r) thn... ls... Th xprssion rf [ ] has typ A = α list rf. This typ is a rf typ, and α is fr in it, hnc α is dangrous in A. Th lt construct dos not gnraliz α, hnc α gts instantiatd to int whn typing r := [1], and typing if had(!r)... lads to a typ clash. Rfrncs may b mbddd into mor complx data structurs (pairs, lists, concrt datatyps). Fortunatly, th typ of a data structur contains nough information to rtriv th typs of th componnts of th structur. For instanc, a pair with typ A B contains on valu of typ A and on valu of typ B. Thrfor, any variabl which is dangrous in A or in B is also dangrous in A B. For instanc, in lt r = ([ ], rf [ ]) in th xprssion ([ ], rf [ ]) has typ α list β list rf, whr β is dangrous but not α. Hnc in, variabl r has typ α. α list β list rf. Th tratmnt of usr-dfind datatyps is similar. Paramtrlss datatyps cannot contain polymorphic data, so thr is no dangrous variabl in thm. Paramtrizd datatyps com in two flavors: thos which introduc nw rf typs (such as typ α foo = A B of α rf ), and thos which don t. Th formr ar tratd lik rf typs: all variabls fr in thir paramtr(s) ar considrd dangrous. Th lattr ar tratd lik product typs: thir dangrous variabls ar th dangrous variabls of thir paramtr(s). 2.2 Functions Function typs ar tratd spcially. Th rason is that a valu with typ A B dos not contain a valu of Pag 2

3 typ A, nor a valu of typ B, in contrast with rgular datatyps such as A B or A list. Hnc it sms thr ar no dangrous variabls in typ A B, vn if A or B contain dangrous variabls thmslvs. For instanc, th function lt mak rf = function x rf x has typ α α rf, and α is not dangrous in it, so it is fully polymorphic. It is actually harmlss by itslf. What s harmful is to apply mak rf to a polymorphic argumnt such as [ ], bind th rsult with a lt construct, and us it with two diffrnt typs. But this is not possibl in th proposd typ systm, sinc mak rf [ ] has typ β list rf, and this typ will not b gnralizd, as β is dangrous in it. In our approach, gnric functions that crat and rturn mutabl objcts ar givn vry gnral typs. Typ safty is nsurd by controlling what can b don with th rsult of thir application, as dscribd abov. Th analysis abov is basd solly on th typ of th function rsult. Hnc, th usag of a polymorphic function is unrstrictd if th function dos not rturn any rfrncs, as witnssd by th absnc of rf typs in its codomain typ. This holds vn if th function allocats rfrncs with statically unknown typs for intrnal purposs, but dos not rturn thm. For instanc, this is th cas for th imprativ map functional givn in th introduction: it is givn typ α, β. (α β) α list β list, th vry sam typ as its purly applicativ countrpart applicativ map. Th imprativ map functional can b substitutd for applicativ map in any contxt. In particular, it can b applid to highly polymorphic argumnts: th xprssion imprativ map (function x x) [ ] is wll-typd, and rturns th fully polymorphic mpty list, vn though two rfrncs wr cratd with typ α list rf. Th typ systm guarants that ths rfrncs ar usd consistntly insid th function, and ar not xportd outsid. Anothr strngth of this typ-basd analysis is its good handling of highr-ordr functions and partial applications. Considr th partial application of applicativ map to mak rf : our typ systm corrctly rcogniz it as harmlss, and givs it th fully polymorphic typ α. α list α rf list. This is not th cas for ML typ systms that attmpt to control th cration of rfrncs (s sction 4). 2.3 Functions with fr variabls Th carful radr may hav noticd a flaw in th discussion abov: w hav nglctd th fact that a function may possss fr variabls. Suppos that a function f has a fr variabl r which is bound to a rfrnc outsid th function. Function f can accss and updat th rfrnc, yt th typ of r dos not ncssarily appar in th typ of f. A classic xampl is th functional prsntation of rfrncs as a pair of functions, on for accss, th othr for updat: lt functional rf x = lt r = rf x in (function ( )!r), (function z r := z) Th xprssion functional rf [ ] has typ (unit α list) (α list unit), whr no typ variabl is dangrous, so it is fully polymorphic, yt it braks typ safty just as rf [ ] dos. Th problm is that th typs of th fr variabls of a function do not appar in th typ of th function. In this contxt, it is usful to think of functions as closurs. Closurs, in contrast with any othr data structur, ar not adquatly dscribd by thir (functional) typ: w do not know anything about th typs of th valus containd in th nvironmnt part of a closur. Our solution is to kp track of what is insid a closur. W associat with any function typ a st of typs, th typs of all variabls fr in th function. W could put this st of typs as a third argumnt to th arrow typ constructor. For tchnical rasons, w find it mor convnint to add an xtra lvl of indirction in rcording this st of typs. Thrfor, ach function typ is adornd with a labl. Labls ar writtn L, M, and labld function typs ar writtn A L B. Sparatly, w rcord constraints on thos labls. Constraints hav th format A L, maning that objcts of typ A ar allowd to occur in nvironmnts of typ L. An nvironmnt of typ L is not rquird to contain a valu of typ A. It is not allowd to contain a valu of a typ B unlss B L is on of th rcordd constraints. This way, function typ labls allow typings of th nvironmnt parts of closurs. For instanc, functional rf now has typ: α L (unit M α) (α N unit) with α rf M, α rf N hnc functional rf [ ] has typ: (unit M β list) (β list N unit) with β list rf M, β list rf N thus rvaling th prsnc of a polymorphic rfrnc in ach function of th pair, and prvnting th gnralization of β. Th rul is that in a functional typ Pag 3

4 A M B, a variabl α is dangrous iff thr xists a constraint C M with α dangrous in C. This typing of closurs givs a prcis account of th intrlaving of intrnal computation and paramtr passing in (currid) functions, and of th possibl data sharing btwn invocations. For instanc, it succds in distinguishing th following two functions: function ( ) rf [ ] : unit L α list rf lt r = rf [ ] in function ( ) r : unit L α list rf with α list rf L Th formr is harmlss, sinc it rturns a frsh rfrnc ach tim, so it can b gnralizd. Th lattr always rturn th sam rfrnc, which is thrfor shard btwn all calls to th function. It must rmain monomorphic, which is indd th cas, sinc α is a dangrous variabl in its typ. Bfor prsnting th typ systm formally, w now giv th main intuitions bhind th typing of closurs. Constraints ar synthsizd during th typing of abstractions, as follows: whn giving typ A M B to th abstraction = function x..., for ach variabl y fr in, w look up th typ C y of y in th typing nvironmnt and rcord th constraint C y M. It is always saf to add nw constraints, sinc th constraints ovr a labl L ar intndd to giv an uppr bound for what can go insid closurs of typ L. (This may lad to lss gnral typs, howvr, sinc mor variabls will b dclard dangrous.) Unifying two labld function typs A L B and C M D is asy: it suffics to idntify both labls L and M, rsulting in a singl labl which bars th prvious constraints on M as wll as thos on L. For instanc, assuming f : int L int, th xprssion if... thn f ls lt z = 1 in function x x + z has typ int L int as wll, with th additional constraint that int L. Finally, to giv th most gnral typ to functionals, w must b abl to gnraliz ovr labls, in th sam way as w gnraliz ovr rgular typ variabls. Considr th functional: function f 2 + (f 1) It must b possibl to apply it to any function mapping intgrs to intgrs, whatvr its closur may contain. Yt if w giv it th typ (int L int) M int without gnralizing ovr L, w could only apply it to functions without fr variabls, assuming thr is no constraint ovr L in th currnt nvironmnt. Instad, th right typing is L. (int L int) M int. In mor complx situations, th currnt nvironmnt contains constraints ovr th labl to b gnralizd. Ths constraints ar dischargd in th typ schma, and rintroducd at spcialization tim. Typ schmas thrfor hav th format V 1... V n. A with Γ, whr th V i ar ithr labls or typ variabls, and Γ is a squnc of constraints. 3 Formalization In this sction, w formaliz a calculus basd on th idas abov. 3.1 Syntax Th languag w considr is th cor ML languag, λ- calculus plus a distinguishd lt construct. W shall assum a built-in int typ, with intgr constants. Th stor is prsntd through th typ A rf of rfrncs to a trm of typ A, and th oprations rf(a), to allocat a nw rfrnc to trm a,!a to gt th contnts of th rfrnc a, and a := b to updat th contnt of a by b. W assum givn a countabl st Var of trm variabls, with typical lmnts x, y. In th following, i rangs ovr intgrs. Th syntax of trms, with typical lmnts a, b, is as follows: a ::= x i λx. a (b a) lt x = a in b rf(a)!a a := b 3.2 Typchcking Typ xprssions, with typical lmnts A, B, hav th following syntax: A ::= X int A L B A rf In th dfinition abov, X stands for a typ variabl, ranging ovr a givn countabl st TVar. Function typs A L B ar annotatd by a labl L, takn from a countabl st Lbl. Labls ar distinct from trm variabls and typ variabls. Typ schmas, with typical lmnt Σ, ar composd of typ xprssions with som typ variabls and som labls univrsally quantifid. Thy also contain a squnc of constraints Γ. Constraints hav th format Σ L. Σ ::= A V 1... V n. A with Γ Γ ::= ɛ Σ L, Γ V ::= X L Pag 4

5 (int) (varspc) (fun) (app) (ltgn) (rf) (assign) E i : int with Γ E(x) = X 1... X n, L 1... L m. A with Γ E x : A{X i B i, L j M j } with Γ{X i B i, L j M j } Γ E[x A] b : B with Γ for all y fr in λx. b, (E(y) L) Γ E λx. b : A L B with Γ E b : A L B with Γ E a : A with Γ E (b a) : B with Γ E a : A with Γ (Σ, Γ ) = Gn(A, E, Γ) E[x Σ] b : B with Γ Γ E lt x = a in b : B with Γ Γ E a : A with Γ E a : A rf with Γ (drf) E rf(a) : A rf with Γ E!a : A with Γ E a : A rf with Γ E b : A with Γ E a := b : A with Γ Figur 1: Th typing ruls. Givn a typ A in th contxt of a constraint squnc Γ, w dfin its fr variabls (labls as wll as typ variabls) F V (A with Γ) and its dangrous fr variabls DV (A with Γ) as follows. Th intuition bhind th dfinition of F V is that th componnts of a functional typ A L B ar not only A, B and L, but also any typ xprssion C such that C L is on of th rcordd constraints. F V (X with Γ) = {X} F V (int with Γ) = F V (A rf with Γ) = F V (A with Γ) F V (A L B with Γ) = {L} F V (A with Γ) F V (B with Γ) F V (Σ with Γ) DV (X with Γ) = DV (int with Γ) = (Σ L) Γ DV (A rf with Γ) = F V (A with Γ) DV (A L B with Γ) = DV (Σ with Γ) (Σ L) Γ To complt th dfinition abov, w xtnd F V and DV to typ schmas and to typing nvironmnts in th obvious way: F V ( ( V 1... V n. A with Γ ) with Γ ) = F V (A with Γ Γ ) \ {V 1... V n } DV ( ( V 1... V n. A with Γ ) with Γ ) = DV (A with Γ Γ ) \ {V 1... V n } F V (E with Γ) = F V (E(x) with Γ) x Dom(E) Th typing ruls ar givn in figur 1. Thy ar vry similar to th ruls for ML, xcpt for th additional handling of constraints, rminiscnt of th tratmnt of subtyping hypothss in typ infrnc systms with subtyps [12, 6]. Th ruls dfin th proposition trm a has typ A undr assumptions E and constraints Γ, writtn E a : A with Γ. Th typing nvironmnt E is a partial mapping from trm variabls to typ schmas. W writ E[x A] for th nvironmnt idntical to E, xcpt that x is mappd to A. W assum th usual st oprations ar dfind ovr constraints Γ in th obvious way. As in Standard ML [11, p. 21], th Gn oprator usd in th (ltgn) rul is rsponsibl for gnralizing as many typ variabls as possibl in a typ. Hr, w also gnraliz ovr labls whnvr possibl. In addition, w prohibit gnralization ovr dangrous typ variabls. A tntativ dfinition would thrfor b Gn(A, E, Γ) = V 1... V n. A whr th st {V 1... V n } is F V (A with Γ) \ DV (A with Γ) \ F V (E with Γ). Howvr, it would b incorrct to gnraliz ovr a variabl which rmains fr in th constraint squnc usd Pag 5

6 i[s] = int(i)[s] x[s] b[s] = (x)[s] (λx. a)[s] = clos(x, c, 1 )[s 1 ] a[s 1 ] = v 2 [s 2 ] c[s 2 ] 1[x v 2 ] = v 3 [s 3 ] (b a)[s] = v 3 [s 3 ] = clos(x, a, F V (a) )[s] a[s] a[s]!a[s] = v 1 [s 1 ] b[s 1 ] [x v1] = v 2 [s 2 ] (lt x = a in b)[s] = loc(l)[s ] = s (l)[s ] = v 2 [s 2 ] a[s] rf(a)[s] a[s] = v[s ] l / Dom(s ) = loc(l)[s [l v]] = loc(l)[s 1 ] b[s 1 ] = v[s 2 ] (a := b)[s] = v[s 2 [l v]] Figur 2: Th valuation ruls latr. Thrfor, Gn also dischargs in th schma all gnric constraints, i.. th constraints in Γ whr on of th V i is fr, and rturns th rmaining constraints, to b usd furthr in th typing drivation. Dfinition 1 (Gnralization) Lt A b a typ xprssion, E b a typing nvironmnt, Γ b a constraint squnc. Dfin: {V 1... V n } = F V (A with Γ) \ DV (A with Γ) \ F V (E with Γ). Lt Γ b th squnc of thos constraints Σ L in Γ such that L is on of th V i. Thn: Gn(A, E, Γ) = ( V 1... V n. A with Γ ), (Γ \ Γ ) 3.3 Evaluation W giv hr an valuation mchanism for trms of our calculus, using structural oprational smantics. Th valuation rlation a[s] = v[s ] maps a trm a, in th contxt of an valuation nvironmnt and a stor s, to som valu v, and a modifid stor s. Valus hav th following syntax: v ::= int(i) clos(x, a, ) loc(l) Hr, l rangs ovr a countabl st Loc of locations. Stors ar partial mappings from locations to valus. Sinc w assum call-by-valu, valuation nvironmnts ar partial mappings from trm variabls to valus. Th ruls givn in figur 2 dfin prcisly th valuation rlation, assuming standard lft-to-right valuation ordr. To account for run-tim typ rrors, w introduc th spcial rsult wrong, and stat that if non of th valuation ruls match, thn a[s] = wrong. This way, w can distinguish btwn typ rrors and nontrmination. 3.4 Soundnss of typing Th typ systm prsntd hr is snsibl with rspct to th valuation mchanism abov: no wll-typd trm can valuat to wrong. Proposition 1 Lt a b a trm, A b a typ, Γ b a squnc of constraints such that w can driv a : A with Γ. Thn, for all stors s 0, a[s 0 ] dos not valuat to wrong; that is, w cannot driv a[s 0 ] = wrong. Th proof can b found in appndix. It closly follows Toft s [16, chaptr 5]. Th crucial point is that closur labls and constraints giv a bttr control ovr th typs of stor locations than in ML. As a consqunc, a variabl cannot b fr in th typ of a location rachabl from a valu without bing dangrous in th typ of that valu. This guarants th soundnss of typ gnralization. 3.5 Typ rconstruction In this sction, w considr an adaptation to our languag of th wll-known Damas-Milnr typ rconstruction algorithm for ML (algorithm W of [5]). In th following, w writ mgu(a, B) for th principal unifir of typs A and B, if A and B ar unifiabl. (Othrwis, th typ infrnc algorithm fails.) Typ xprssions ar trms of a two-sortd fr algbra, hnc this nsurs th xistnc of a principal unifir, that can b obtaind by th classical unification algorithm btwn trms of a fr algbra. Lt a b a trm, E b a typing nvironmnt, and Γ b an initial squnc of constraints. W dfin infr(e, a, Γ) as th tripl (A, σ, ), whr A is a typ xprssion, σ a substitution and a constraint squnc, as follows: Pag 6

7 infr(e, i, Γ) = (int, Id, Γ) infr(e, x, Γ) = lt ( X 1... X n, L 1... L m. A with ) = E(x) lt Y 1,..., Y n b frsh typ variabls (not fr in E nor in A) and M 1,..., M m b frsh labls lt σ = {X i Y i, L j M j } in (σa, Id, Γ σ ) infr(e, λx. b, Γ) = lt X, L b frsh variabls lt Θ = {E(y) L y fr in λx. b} lt B, σ, = infr(e[x X], b, Γ Θ) in (σx L B, σ, ) infr(e, (b a), Γ) = lt B, ρ, Θ = infr(e, b, Γ) lt A, σ, = infr(ρe, a, Θ) lt X, L b frsh variabls lt µ = mgu(σb, A L X) in (µx, µσρ, µ ) infr(e, lt x = a in b, Γ) = lt A, σ, = infr(e, a, Γ) lt Σ, = Gn(A, σe, ) lt B, ρ, Θ = infr((σe)[x Σ], b, ) in (B, ρσ, Θ) infr(e, rf(a), Γ) = lt A, σ, = infr(e, a, Γ) in (A rf, σ, ) infr(e,!a, Γ) = lt A, σ, = infr(e, a, Γ) lt X b a frsh variabl lt µ = mgu(a, X rf ) in (µx, µσ, µ ) infr(e, a := b, Γ) = lt A, σ, = infr(e, a, Γ) lt B, ρ, Θ = infr(σe, b, ) lt µ = mgu(ρa, B rf ) in (µb, µρσ, µθ) This algorithm njoys th good proprtis of th Damas-Milnr algorithm: it is corrct and complt with rspct to th typing ruls, and th infrrd typ is th most gnral on. Th proof is vry similar to Damas proof [4]. 3.6 Rlation to ML W hav introducd closur typing as a way to kp track of mutabl valus mbddd in functions. As a consqunc, two xprssions having th sam functional typ in ML may now b distinguishd by thir closur typ, and w may far that this lads to a typ systm mor rstrictiv than th on of ML. Idally, w would lik th purly applicativ fragmnt of our calculus (that is, without th rf typ constructor, and th rf, := and! trm constructors) to b a consrvativ xtnsion of ML: any pur, closd trm that is wll-typd in ML should also b wll-typd in our calculus. Unfortunatly, this is not th cas but for mor subtl rasons than th on outlind abov. Actually, two typ xprssions in our systm cannot b distinguishd by thir closur labls only. Th rason is that unification cannot fail bcaus of th labls: givn th syntax of typ xprssions, a labl can only b matchd against anothr labl, and labls ar tratd as variabls as far as unification is concrnd. Thrfor, in our systm, unification btwn typs is consrvativ with rspct to unification btwn th corrsponding ML typs. To b mor prcis, w introduc th strip oprator, that maps typ xprssions in our calculus to ML typ xprssions, by rasing th labls from function typs: int = int X = X (A rf ) = A rf (A M B) = A B Thn, two typ xprssions A and B ar unifiabl if and only if A and B ar, and in this cas, taking σ = mgu(a, B) and ρ = mgu(a, B ), w hav (σc) = ρ(c ) for all typs C. This lmma, along with th clos rsmblanc btwn our algorithm infr and Damas-Milnr s W algorithm, lad us to bliv that, givn th sam pur trm, both algorithms infr th sam typ, modulo closur labls. Howvr, this dos not hold bcaus of th gnralization stp in th cas of a lt construct. Considr th typing of lt x = a in b. Assum that, starting from typing nvironmnt E, algorithm infr infrs typ A with Γ for a, whil algorithm W, starting from th corrsponding ML typing nvironmnt E, infrs th corrsponding ML typ A. W must chck that both algorithms gnraliz xactly th sam typ variabls, so that thy will typ b in compatibl nvironmnts. This could b not th cas for two rasons. Th first rason is that algorithm infr dos not gnraliz dangrous typ variabls, whil W dos. But this is no problm hr, sinc w considr only th pur fragmnt of our calculus, without th rf typ constructor, hnc th st of dangrous variabls of any typ is always mpty. Pag 7

8 Th scond, mor srious rason is that closur typing introducs additional fr variabls in a givn typ. In gnral, F T V (A with Γ), th st of fr typ variabls in A with Γ, is a suprst of F V (A ). (Tak for instanc A = int L int and Γ = X L.) So it is not obvious that F T V (A with Γ) \ F T V (E with Γ), th st of typ variabls gnralizd by infr, is th sam as F V (A ) \ F V (E ), th st of typ variabls gnralizd by W. Indd, thr ar cass whr infr dos not gnraliz som typ variabl X, whil W dos, bcaus X is fr in E with Γ, but not in E. Considr: λz. lt id = λx. ( if... thn z ls (λy. x; y) ) ; x in id id Assuming x : X and y : Y, th trm (λy. x; y) is givn typ Y M Y with X M, and th if construct forcs z to hav th sam typ. Thrfor, whn w attmpt to gnraliz X L X (th typ of λx.... ; x), w hav E(z) = Y M Y undr constraints Γ = X M, Y M Y L, and w cannot gnraliz ovr X, sinc it is fr in th typ of z. Hnc, id rmains monomorphic, and th application id id is ill-typd. In ML, w would hav z : Y Y, so w could frly gnraliz ovr X, gtting id : X. X X, and th whol trm would b wll-typd. Th xampl abov is quit convolutd, and it is th simplst on w know that xhibits this variabl captur through labls phnomnon. W nd mor xprinc with th proposd typ systm to find whthr this phnomnon happns in mor practical situations. Howvr, in cas this turns out to b a srious flaw of our closur typing systm, w ar invstigating two possibl improvmnts that sm to avoid variabl capturs. On dirction is to rcord lss constraints whn typing a λ-abstraction. In th xampl abov, on could argu that th constraint X M should not b rcordd, on th grounds that x is not actually usd in th body of th function, as witnssd by th fact that th typ variabl X is not fr in th typ of th function rsult, nor in th typ of th paramtr. Th othr dirction is to chck that two function typs ar compatibl without actually idntifying thir closur typs. This way, w could avoid th propagation of th constraint X M to th typ of z. 3.7 Pragmatics of constraint handling Practically, th main concrn with th typ infrnc algorithm abov is th additional ovrhad introducd by th handling of constraints. First, it is possibl to simplify squncs of constraints. Hr ar som possibl simplification ruls: Σ M, Σ M Σ M Σ M ɛ if Σ is closd A B M A M, B M Ths thr simplifications ar obviously sound with rspct to th computation of fr and dangrous variabls. Th third rul actually gnrat mor constraints, but this may opn th way to furthr simplifications,.g. if A = B, or if A is closd. In addition, constraint handling bcoms quit chap if w distribut constraints insid typs, instad of handling a singl list of constraints. W suggst grouping togthr all constraints ovr th sam labl L, arrangd as a list of typ schms. This list rprsnts th labl L itslf. To idntify two labls, w just hav to concatnat th two lists, and this can b don in constant tim, using.g. diffrnc lists. Hnc, whn unifying two typ xprssions A and B, th additional work of idntifying labls taks tim at most proportional to th siz of A, B. Thrfor, unification can b prformd in linar tim, as in ML. 4 Comparison with othr typ systms In this sction, w compar our typ systm with prvious proposals of polymorphic typ systms for languags faturing physical modification. 4.1 Standard ML W considr first th systms proposd for ML. All ths systms rly on dtcting th cration of mutabl valus (.g. by spcial typchcking ruls for th rf construct), and nsuring that th rsulting mutabl valus hav monomorphic typs. Th first systm w considr is th on proposd by Toft [16, 17], and adoptd in Standard ML [11]. It maks us of wak typ variabls (writtn with a suprscript) to prohibit polymorphic rfrncs. Wak typ variabls cannot b gnralizd by a lt binding, unlss th corrsponding xprssion is guarantd to b non-xpansiv, i.. that it dos not crat any rfrncs. Damas [4] proposd a rlatd, but slightly diffrnt schm, that givs similar rsults in most cass. Th othr systm is an xtnsion of Toft s, usd in th Standard ML of Nw Jrsy implmntation [1]. In this schm, typ variabls ar no longr partitiond into wak and non-wak variabls; instad, ach typ Pag 8

9 Standard ML SML-NJ Our systm mak rf α α rf α 1 α 1 rf α L α rf mak rf [ ] rjctd rjctd rjctd imprativ map (α β ) α list β list (α 2 β 2 ) α 2 list β 2 list imprativ map id [ ] rjctd rjctd α list (α L β) M α list N β list with α L β N applicativ map mak rf rjctd rjctd α list L α rf list id mak rf rjctd rjctd α L α rf (rais Exit : α rf ) α rf α rf rjctd Figur 3: Comparison with othr typ systms variabl has an associatd intgr, its dgr of waknss, or strngth. This dgr masurs th numbr of abstractions that hav to b applid bfor th corrsponding rfrnc is actually cratd. Rgular, unconstraind typ variabls hav strngth infinity. Variabls with strngth zro cannot b gnralizd. Variabls with strngth n > 0 can b gnralizd, but ach function application dcrmnts th strngth of variabls. Th comparativ rsults ar givn in figur 3. For ach tst program, w giv its most gnral typ in ach systm. W assum ths ar top-lvl phrass. As in most ML implmntations, w rjct top-lvl phrass whos typs cannot b closd (bcaus som fr variabls cannot b gnralizd). Th first tst is th mak rf function, dfind as function x rf x. It xrciss th possibility of writing gnric functions that crat and rturn updatabl data structurs. Most functions ovr vctors, matrixs, doubly linkd lists,... ar typd similarly. All typ systms considrd hr captur th fact that mak rf should b applicabl to monomorphic valus only. Th scond tst is th imprativ map functional givn in th introduction. It illustrats th us of polymorphic rfrncs as auxiliaris insid a gnric function. Our typ systm is th only on which givs a fully polymorphic typ to imprativ map. Th othrs rstrict it to b usd with monomorphic typ. Th third tst is th partial application of applicativ map, dfind in th introduction, to th mak rf function. It xrciss th compatibility btwn functions that crat mutabl data and highrordr functions. SML and SML-NJ rfus to gnraliz its typ, hnc rjct it. Thy ar unabl to dtct that applicativ map dos not apply mak rf immdiatly, hnc that applicativ map mak rf dos not crat any polymorphic rfrnc. A simplifid vrsion of this tst, shown blow, is to apply th idntity function id to th mak rf function. Our typ systm givs th sam typ to id mak rf and to mak rf. Th othrs don t, and w tak this as strong vidnc that thy do not handl full functionality corrctly. Th last xampl illustrats a waknss of our typbasd approach. By using xcptions, for instanc, on may mimic th cration of a rfrnc as far as typs ar concrnd, without actually crating on. In th xprssion (rais Exit : α rf ), our typ systm considrs that α is dangrous and dos not gnraliz it. Othr typ systms rcogniz that no rfrncs ar cratd, hnc thy corrctly gnraliz it. This flaw of our mthod has littl impact on actual programming, howvr. 4.2 Qust In our systm, w mad no attmpt at rstricting th cration of mutabl valus, and concntratd on typ gnralization instad. W wr inspird by Cardlli s Qust languag [2], which dparts significantly from ML, but faturs mutabl data structurs and polymorphic typing. Qust maks almost no typing rstrictions for mutabl valus. Soundnss is nsurd by diffrnt smantics for typ spcialization. Namly, an xprssion with polymorphic typ is valuatd ach tim its typ is spcializd, in contrast with ML, whr it would b valuatd only onc. This is consistnt with th fact that polymorphism is xplicit in Qust programs: polymorphic objcts ar actually prsntd as functions that tak a typ as argumnt and rturn a spcializd vrsion of th objct. But ths smantics ar incompatibl with ML, whr gnralization and spcialization ar kpt implicit in th sourc program. Pag 9

10 4.3 FX Th FX ffct systm [9] is a polymorphic typ systm that prforms purity analysis as wll: th typ of an xprssion indicats what kind of sid-ffcts its valuation can prform. This provids a simpl way to dal with th problm of mutabl valus: th typ of an xprssion cannot b gnralizd unlss this xprssion is rfrntially transparnt. It is asy to s that such pur xprssions can safly b usd with diffrnt typs. Though this approach is attractiv for othr purposs (.g. automatic program paralllization), it dfinitly dos not addrss th main issu considrd hr: how to giv th sam typ to smantically quivalnt functions, whthr writtn in applicativ styl or in imprativ styl. Th rason is that th purity analysis of FX maks it apparnt in th typs whthr a function allocats mutabl data for local purposs. For instanc, imprativ map and applicativ map do not hav th sam typ in FX. 5 Conclusion W hav prsntd hrin an xtnsion of th ML typ systm that considrably nhancs th support for data accpting in-plac modification. This is a significant stp toward th intgration of polymorphic typ disciplin and imprativ programming styl. W hav introducd th notion of closur typing, which is ssntial to th soundnss of this approach. W hav givn on typ systm that prforms this closur typing, basd upon labls and constraints. Our systm is simpl, but falls short of bing a consrvativ xtnsion of ML. Furthr work includs invstigating altrnat, mor subtl ways to typchck closurs, that would not rjct any wll-typd ML program, whil corrctly kping track of mutabl data. Th scop of this work is not strictly limitd to th problm of mutabl data structurs. For instanc, it is wll-known that polymorphic xcptions rais th sam issus as rfrncs, and can b handld in th sam way. Mor gnrally, similar problms aris in th intgration of polymorphic typing within svral othr programming paradigms. For instanc, on approach to th intgration of functional and logic programming is to allow partially dfind valus containing logical variabls within a convntional functional languag [15]. Polymorphic logical variabls brak typ safty just as polymorphic rfrncs do, and ar amnabl to th sam tratmnt. In objct-orintd programming, status variabls of objcts can b sn as rfrncs systmatically ncapsulatd in functions (th mthods). Closur typing sms rlvant to th polymorphic typchcking of such objcts. Finally, som calculi of communicating systms fatur channls as first-class valus [10]. Polymorphic typing of ths channls must guarant that sndrs and rcivrs agr on th typs of transmittd valus, and this is similar to nsuring that writrs and radrs of a rfrnc us it consistntly [13]. Acknowldgmnts Didir Rémy suggstd th us of constraints in th typing ruls. W also bnfitd from his xprtis in typ infrnc and unification problms. Many thanks to Brad Chn for his ditorial hlp. A Proof of soundnss In this appndix, w sktch th proof of soundnss of th typ systm with rspct to th oprational smantics givn in sction 3.3. W formaliz th fact that a valu v smantically blongs to a typ xprssion A undr constraints Γ. W writ this S = v : A with Γ. Th hypothsis S is a stor typing, that is, a partial mapping from locations to typ xprssions. Th stor typing is ndd to tak into account th sharing of valus introducd by th stor. Dfinition 2 (Smantic typing judgmnts) Lt S b a stor typing, v a valu, A a typ, Γ a constraint squnc. Th prdicat S = v : A with Γ is dfind by induction on v: S = int(i) : int with Γ. S = loc(l) : (A rf) with Γ iff l blongs to th domain of S, and S(l) = A. S = clos(x, b, ) : (A M B) with Γ iff for all x Dom(), thr xists a typ schma Σ such that Σ M is in Γ, and S = (x) : Σ with Γ; and thr xists a typing nvironmnt E such that E[x A] b : B with Γ. Th prdicat abov is xtndd to typ schmas by taking S = v : ( V 1... V n. A with Γ ) with Γ iff for all substitutions µ ovr V 1... V n, w hav S = v : µa with Γ µγ Lt b an valuation nvironmnt, and E b a typing nvironmnt. W say that S = : E with Γ iff Dom() Dom(E) and for all x Dom(), w hav S = (x) : E(x) with Γ. Pag 10

11 Similarly, lt s b a stor. W say that = s : S with Γ if Dom(s) Dom(S) and for all l Dom(s), w hav S = s(l) : S(l) with Γ. In th proof of soundnss, w will us th fact that th smantic typing judgmnt is stabl undr substitution. Lmma 1 (Smantic substitution) If S = v : A with Γ, thn µs = v : µa with µγ for all substitutions µ. Starting from a givn valu v, it is not possibl in gnral to accss any location in th stor. Th st R(v) of locations rachabl from v is dfind by induction on v, as follows. Dfinition 3 (Rachabl locations) R(int(i)) = R(loc(l)) = {l} R(clos(x, a, )) = y Dom() R((y)) In th dfinition of S = v : A with Γ, th typs of th locations that cannot b rachd from v ar irrlvant. W can actually assum any othr typ for thos locations: Lmma 2 (Garbag collction) Lt S, S b two stor typings such that S(l) = S (l) for all l R(v). If S = v : A with Γ, thn S = v : A with Γ Our typ xprssions ar informativ nough to allow us to connct th typ of a location l rachabl from a valu v with th typ A of v. Mor prcisly, w hav th following ky lmma which rlats th variabls fr in th typ of l with th dangrous variabls of A. Lmma 3 (Stor typing control) Assum S = v : A with Γ. Lt l b a location in R(v). Thn F V (S(l) with Γ) DV (A with Γ). Proof: By induction on v. Cas 1: A = int and v = int(i). Obvious, sinc thr ar no locations rachabl from v. Cas 2: A = B rf, v = loc(l ), and S(l ) = B. By dfinition of th rachabl locations, l = l. Hnc F V (S(l) with Γ) = F V (B with Γ) = DV (A with Γ). L Cas 3: A = A 1 A2, and v = clos(x, a, ). Lt y b a variabl such that l is rachabl from (y). Lt Σ b a typ schm such that S = (y) : Σ and (Σ L) Γ. W writ V 1... V n. B with Γ for Σ. For all substitutions µ ovr V 1... V n, sinc S = (y) : µb with Γ µγ, w gt by induction hypothsis: Taking wll-chosn substitutions µ, it follows that: F V (S(l) with Γ) DV (B with Γ Γ ) \ {V 1... V n } Hnc th dsird rsult: F V (S(l) with Γ) DV (Σ with Γ) DV (A with Γ) W ar now rady to show th soundnss of th typing ruls. Proposition 2 (Soundnss) Assum E a : A with Γ. Lt b an valuation nvironmnt, s a stor, S a stor typing such that: S = : E with Γ = s : S with Γ. Assum a[s] = w. Thn, w = v[s ], and thr xists a stor typing S xtnding S, such that: S = v : A with Γ = s : S with Γ Proof: By induction on th lngth of th valuation. All cass procd as in Toft s proof [16, chaptr 5], xcpt whn a is a lt binding. Thn, th last stp of th typing drivation is: E a : A with Γ (Σ, Γ ) = Gn(A, E, Γ) E[x Σ] b : B with Γ E lt x = a in b : B with Γ Applying th induction hypothsis to th first prmis, w gt v a, s a, S a xtnding S such that: a[s] = v a [s a ] S a = v a : A with Γ = s a : S a with Γ. To apply th induction hypothsis to th last prmis, w nd to show that: S a = [x v a ] : E[x Σ] with Γ whr w writ (Σ, Γ ) for Gn(A, E, Γ), and V 1... V n. A with Γ for Σ. Sinc S a xtnds S, and V 1... V n ar not fr in E, w alrady hav S a = : E with Γ as a corollary of lmma 2. It rmains to show that: S a = v a : ( V 1... V n. A with Γ ) with Γ. To do so, w must prov that, for any substitution µ ovr th V i, (1) S a = v a : µa with Γ µγ. Sinc S a = v a : A with Γ, w hav, by lmma 1, F V (S(l) with Γ µγ ) DV (µb with Γ µγ ) (2) µs a = v a : µa with µγ. Pag 11

12 By dfinition of Gn, non of th V i appars in any constraint of Γ, hnc (3) µ(γ) = µ(γ Γ ) = Γ µγ. By lmma 3, for any location l rachabl from v a, w hav F V (S a (l) with Γ) DV (A with Γ), and non of th V i is dangrous in A with Γ, hnc non of th V i is fr in S a (l). Thrfor, (4) (µs a )(l) = S a (l) for all l R(v a ) and th claim (1) abov follows from (2), (3), (4), and lmma 2. Thrfor, w can apply th induction hypothsis to th right branch of th typing drivation, gtting v b, s b, S b xtnding S a such that: b[s a ] [x v a] = v b [s b ] S b = v b : B with Γ = s b : S b with Γ which is th xpctd rsult. Rfrncs [1] A. W. Appl and D. B. MacQun. Standard ML rfrnc manual (prliminary). AT&T Bll Laboratoris, Includd in th Standard ML of Nw Jrsy distribution. [2] L. Cardlli. Typful programming. In E. J. Nuhold and M. Paul, ditors, Formal Dscription of Programming Concpts, pags Springr-Vrlag, [3] G. Cousinau and G. Hut. Th CAML primr. Tchnical rport 122, INRIA, [4] L. Damas. Typ assignmnt in programming languags. PhD thsis, Univrsity of Edinburgh, [8] M. J. Gordon, A. J. Milnr, and C. P. Wadsworth. Edinburgh LCF, volum 78 of Lctur Nots in Computr Scinc. Springr-Vrlag, [9] J. M. Lucassn and D. K. Gifford. Polymorphic ffct systms. In 15th symposium Principls of Programming Languags, pags ACM Prss, [10] R. Milnr, J. Parrow, and D. Walkr. A calculus of mobil procsss: part 1. Rsarch rport ECS- LFCS-89-85, Univrsity of Edinburgh, [11] R. Milnr, M. Toft, and R. Harpr. Th dfinition of Standard ML. Th MIT Prss, [12] J. C. Mitchll. Corcion and typ infrnc. In 11th symposium Principls of Programming Languags, pags ACM Prss, [13] J. H. Rppy. First-class synchronous oprations in Standard ML. Tchnical Rport TR , Cornll Univrsity, [14] J. C. Rynolds. Toward a thory of typ structur. In Programming Symposium, Paris, 1974, volum 19 of Lctur Nots in Computr Scinc, pags Springr-Vrlag, [15] G. Smolka. FRESH: a highr-ordr languag with unification and multipl rsults. In D. DGroot and G. Lindstrom, ditors, Logic Programming: Functions, Rlations, and Equations, pags Prntic-Hall, [16] M. Toft. Oprational smantics and polymorphic typ infrnc. PhD thsis CST-52-88, Univrsity of Edinburgh, [17] M. Toft. Typ infrnc for polymorphic rfrncs. Information and Computation, 89(1), [5] L. Damas and R. Milnr. Principal typ-schms for functional programs. In 9th symposium Principls of Programming Languags, pags ACM Prss, [6] Y.-C. Fuh and P. Mishra. Typ infrnc with subtyps. In ESOP 88, volum 300 of Lctur Nots in Computr Scinc, pags Springr Vrlag, [7] J.-Y. Girard. Intrprétation fonctionnll t élimination ds coupurs d l arithmétiqu d ordr supériur. Thès d État, Univrsité Paris VII, Pag 12

UNTYPED LAMBDA CALCULUS (II)

UNTYPED LAMBDA CALCULUS (II) 1 UNTYPED LAMBDA CALCULUS (II) RECALL: CALL-BY-VALUE O.S. Basic rul Sarch ruls: (\x.) v [v/x] 1 1 1 1 v v CALL-BY-VALUE EVALUATION EXAMPLE (\x. x x) (\y. y) x x [\y. y / x] = (\y. y) (\y. y) y [\y. y /

More information

Higher order derivatives

Higher order derivatives Robrto s Nots on Diffrntial Calculus Chaptr 4: Basic diffrntiation ruls Sction 7 Highr ordr drivativs What you nd to know alrady: Basic diffrntiation ruls. What you can larn hr: How to rpat th procss of

More information

Abstract Interpretation. Lecture 5. Profs. Aiken, Barrett & Dill CS 357 Lecture 5 1

Abstract Interpretation. Lecture 5. Profs. Aiken, Barrett & Dill CS 357 Lecture 5 1 Abstract Intrprtation 1 History On brakthrough papr Cousot & Cousot 77 (?) Inspird by Dataflow analysis Dnotational smantics Enthusiastically mbracd by th community At last th functional community... At

More information

Introduction to Arithmetic Geometry Fall 2013 Lecture #20 11/14/2013

Introduction to Arithmetic Geometry Fall 2013 Lecture #20 11/14/2013 18.782 Introduction to Arithmtic Gomtry Fall 2013 Lctur #20 11/14/2013 20.1 Dgr thorm for morphisms of curvs Lt us rstat th thorm givn at th nd of th last lctur, which w will now prov. Thorm 20.1. Lt φ:

More information

COMPUTER GENERATED HOLOGRAMS Optical Sciences 627 W.J. Dallas (Monday, April 04, 2005, 8:35 AM) PART I: CHAPTER TWO COMB MATH.

COMPUTER GENERATED HOLOGRAMS Optical Sciences 627 W.J. Dallas (Monday, April 04, 2005, 8:35 AM) PART I: CHAPTER TWO COMB MATH. C:\Dallas\0_Courss\03A_OpSci_67\0 Cgh_Book\0_athmaticalPrliminaris\0_0 Combath.doc of 8 COPUTER GENERATED HOLOGRAS Optical Scincs 67 W.J. Dallas (onday, April 04, 005, 8:35 A) PART I: CHAPTER TWO COB ATH

More information

cycle that does not cross any edges (including its own), then it has at least

cycle that does not cross any edges (including its own), then it has at least W prov th following thorm: Thorm If a K n is drawn in th plan in such a way that it has a hamiltonian cycl that dos not cross any dgs (including its own, thn it has at last n ( 4 48 π + O(n crossings Th

More information

Propositional Logic. Combinatorial Problem Solving (CPS) Albert Oliveras Enric Rodríguez-Carbonell. May 17, 2018

Propositional Logic. Combinatorial Problem Solving (CPS) Albert Oliveras Enric Rodríguez-Carbonell. May 17, 2018 Propositional Logic Combinatorial Problm Solving (CPS) Albrt Olivras Enric Rodríguz-Carbonll May 17, 2018 Ovrviw of th sssion Dfinition of Propositional Logic Gnral Concpts in Logic Rduction to SAT CNFs

More information

Construction of asymmetric orthogonal arrays of strength three via a replacement method

Construction of asymmetric orthogonal arrays of strength three via a replacement method isid/ms/26/2 Fbruary, 26 http://www.isid.ac.in/ statmath/indx.php?modul=prprint Construction of asymmtric orthogonal arrays of strngth thr via a rplacmnt mthod Tian-fang Zhang, Qiaoling Dng and Alok Dy

More information

(Upside-Down o Direct Rotation) β - Numbers

(Upside-Down o Direct Rotation) β - Numbers Amrican Journal of Mathmatics and Statistics 014, 4(): 58-64 DOI: 10593/jajms0140400 (Upsid-Down o Dirct Rotation) β - Numbrs Ammar Sddiq Mahmood 1, Shukriyah Sabir Ali,* 1 Dpartmnt of Mathmatics, Collg

More information

CS 361 Meeting 12 10/3/18

CS 361 Meeting 12 10/3/18 CS 36 Mting 2 /3/8 Announcmnts. Homwork 4 is du Friday. If Friday is Mountain Day, homwork should b turnd in at my offic or th dpartmnt offic bfor 4. 2. Homwork 5 will b availabl ovr th wknd. 3. Our midtrm

More information

The Matrix Exponential

The Matrix Exponential Th Matrix Exponntial (with xrciss) by D. Klain Vrsion 207.0.05 Corrctions and commnts ar wlcom. Th Matrix Exponntial For ach n n complx matrix A, dfin th xponntial of A to b th matrix A A k I + A + k!

More information

The Matrix Exponential

The Matrix Exponential Th Matrix Exponntial (with xrciss) by Dan Klain Vrsion 28928 Corrctions and commnts ar wlcom Th Matrix Exponntial For ach n n complx matrix A, dfin th xponntial of A to b th matrix () A A k I + A + k!

More information

Abstract Interpretation: concrete and abstract semantics

Abstract Interpretation: concrete and abstract semantics Abstract Intrprtation: concrt and abstract smantics Concrt smantics W considr a vry tiny languag that manags arithmtic oprations on intgrs valus. Th (concrt) smantics of th languags cab b dfind by th funzcion

More information

Addition of angular momentum

Addition of angular momentum Addition of angular momntum April, 0 Oftn w nd to combin diffrnt sourcs of angular momntum to charactriz th total angular momntum of a systm, or to divid th total angular momntum into parts to valuat th

More information

General Notes About 2007 AP Physics Scoring Guidelines

General Notes About 2007 AP Physics Scoring Guidelines AP PHYSICS C: ELECTRICITY AND MAGNETISM 2007 SCORING GUIDELINES Gnral Nots About 2007 AP Physics Scoring Guidlins 1. Th solutions contain th most common mthod of solving th fr-rspons qustions and th allocation

More information

Brief Introduction to Statistical Mechanics

Brief Introduction to Statistical Mechanics Brif Introduction to Statistical Mchanics. Purpos: Ths nots ar intndd to provid a vry quick introduction to Statistical Mchanics. Th fild is of cours far mor vast than could b containd in ths fw pags.

More information

1 Isoparametric Concept

1 Isoparametric Concept UNIVERSITY OF CALIFORNIA BERKELEY Dpartmnt of Civil Enginring Spring 06 Structural Enginring, Mchanics and Matrials Profssor: S. Govindj Nots on D isoparamtric lmnts Isoparamtric Concpt Th isoparamtric

More information

COUNTING TAMELY RAMIFIED EXTENSIONS OF LOCAL FIELDS UP TO ISOMORPHISM

COUNTING TAMELY RAMIFIED EXTENSIONS OF LOCAL FIELDS UP TO ISOMORPHISM COUNTING TAMELY RAMIFIED EXTENSIONS OF LOCAL FIELDS UP TO ISOMORPHISM Jim Brown Dpartmnt of Mathmatical Scincs, Clmson Univrsity, Clmson, SC 9634, USA jimlb@g.clmson.du Robrt Cass Dpartmnt of Mathmatics,

More information

A Propagating Wave Packet Group Velocity Dispersion

A Propagating Wave Packet Group Velocity Dispersion Lctur 8 Phys 375 A Propagating Wav Packt Group Vlocity Disprsion Ovrviw and Motivation: In th last lctur w lookd at a localizd solution t) to th 1D fr-particl Schrödingr quation (SE) that corrsponds to

More information

1 Minimum Cut Problem

1 Minimum Cut Problem CS 6 Lctur 6 Min Cut and argr s Algorithm Scribs: Png Hui How (05), Virginia Dat: May 4, 06 Minimum Cut Problm Today, w introduc th minimum cut problm. This problm has many motivations, on of which coms

More information

u 3 = u 3 (x 1, x 2, x 3 )

u 3 = u 3 (x 1, x 2, x 3 ) Lctur 23: Curvilinar Coordinats (RHB 8.0 It is oftn convnint to work with variabls othr than th Cartsian coordinats x i ( = x, y, z. For xampl in Lctur 5 w mt sphrical polar and cylindrical polar coordinats.

More information

BINOMIAL COEFFICIENTS INVOLVING INFINITE POWERS OF PRIMES

BINOMIAL COEFFICIENTS INVOLVING INFINITE POWERS OF PRIMES BINOMIAL COEFFICIENTS INVOLVING INFINITE POWERS OF PRIMES DONALD M. DAVIS Abstract. If p is a prim (implicit in notation and n a positiv intgr, lt ν(n dnot th xponnt of p in n, and U(n n/p ν(n, th unit

More information

LINEAR DELAY DIFFERENTIAL EQUATION WITH A POSITIVE AND A NEGATIVE TERM

LINEAR DELAY DIFFERENTIAL EQUATION WITH A POSITIVE AND A NEGATIVE TERM Elctronic Journal of Diffrntial Equations, Vol. 2003(2003), No. 92, pp. 1 6. ISSN: 1072-6691. URL: http://jd.math.swt.du or http://jd.math.unt.du ftp jd.math.swt.du (login: ftp) LINEAR DELAY DIFFERENTIAL

More information

ph People Grade Level: basic Duration: minutes Setting: classroom or field site

ph People Grade Level: basic Duration: minutes Setting: classroom or field site ph Popl Adaptd from: Whr Ar th Frogs? in Projct WET: Curriculum & Activity Guid. Bozman: Th Watrcours and th Council for Environmntal Education, 1995. ph Grad Lvl: basic Duration: 10 15 minuts Stting:

More information

Search sequence databases 3 10/25/2016

Search sequence databases 3 10/25/2016 Sarch squnc databass 3 10/25/2016 Etrm valu distribution Ø Suppos X is a random variabl with probability dnsity function p(, w sampl a larg numbr S of indpndnt valus of X from this distribution for an

More information

Fourier Transforms and the Wave Equation. Key Mathematics: More Fourier transform theory, especially as applied to solving the wave equation.

Fourier Transforms and the Wave Equation. Key Mathematics: More Fourier transform theory, especially as applied to solving the wave equation. Lur 7 Fourir Transforms and th Wav Euation Ovrviw and Motivation: W first discuss a fw faturs of th Fourir transform (FT), and thn w solv th initial-valu problm for th wav uation using th Fourir transform

More information

Application of Vague Soft Sets in students evaluation

Application of Vague Soft Sets in students evaluation Availabl onlin at www.plagiarsarchlibrary.com Advancs in Applid Scinc Rsarch, 0, (6):48-43 ISSN: 0976-860 CODEN (USA): AASRFC Application of Vagu Soft Sts in studnts valuation B. Chtia*and P. K. Das Dpartmnt

More information

BINOMIAL COEFFICIENTS INVOLVING INFINITE POWERS OF PRIMES. 1. Statement of results

BINOMIAL COEFFICIENTS INVOLVING INFINITE POWERS OF PRIMES. 1. Statement of results BINOMIAL COEFFICIENTS INVOLVING INFINITE POWERS OF PRIMES DONALD M. DAVIS Abstract. If p is a prim and n a positiv intgr, lt ν p (n dnot th xponnt of p in n, and u p (n n/p νp(n th unit part of n. If α

More information

The second condition says that a node α of the tree has exactly n children if the arity of its label is n.

The second condition says that a node α of the tree has exactly n children if the arity of its label is n. CS 6110 S14 Hanout 2 Proof of Conflunc 27 January 2014 In this supplmntary lctur w prov that th λ-calculus is conflunt. This is rsult is u to lonzo Church (1903 1995) an J. arkly Rossr (1907 1989) an is

More information

Basic Polyhedral theory

Basic Polyhedral theory Basic Polyhdral thory Th st P = { A b} is calld a polyhdron. Lmma 1. Eithr th systm A = b, b 0, 0 has a solution or thr is a vctorπ such that π A 0, πb < 0 Thr cass, if solution in top row dos not ist

More information

Addition of angular momentum

Addition of angular momentum Addition of angular momntum April, 07 Oftn w nd to combin diffrnt sourcs of angular momntum to charactriz th total angular momntum of a systm, or to divid th total angular momntum into parts to valuat

More information

Homework #3. 1 x. dx. It therefore follows that a sum of the

Homework #3. 1 x. dx. It therefore follows that a sum of the Danil Cannon CS 62 / Luan March 5, 2009 Homwork # 1. Th natural logarithm is dfind by ln n = n 1 dx. It thrfor follows that a sum of th 1 x sam addnd ovr th sam intrval should b both asymptotically uppr-

More information

Einstein Equations for Tetrad Fields

Einstein Equations for Tetrad Fields Apiron, Vol 13, No, Octobr 006 6 Einstin Equations for Ttrad Filds Ali Rıza ŞAHİN, R T L Istanbul (Turky) Evry mtric tnsor can b xprssd by th innr product of ttrad filds W prov that Einstin quations for

More information

Derangements and Applications

Derangements and Applications 2 3 47 6 23 Journal of Intgr Squncs, Vol. 6 (2003), Articl 03..2 Drangmnts and Applications Mhdi Hassani Dpartmnt of Mathmatics Institut for Advancd Studis in Basic Scincs Zanjan, Iran mhassani@iasbs.ac.ir

More information

First derivative analysis

First derivative analysis Robrto s Nots on Dirntial Calculus Chaptr 8: Graphical analysis Sction First drivativ analysis What you nd to know alrady: How to us drivativs to idntiy th critical valus o a unction and its trm points

More information

The van der Waals interaction 1 D. E. Soper 2 University of Oregon 20 April 2012

The van der Waals interaction 1 D. E. Soper 2 University of Oregon 20 April 2012 Th van dr Waals intraction D. E. Sopr 2 Univrsity of Orgon 20 pril 202 Th van dr Waals intraction is discussd in Chaptr 5 of J. J. Sakurai, Modrn Quantum Mchanics. Hr I tak a look at it in a littl mor

More information

SECTION where P (cos θ, sin θ) and Q(cos θ, sin θ) are polynomials in cos θ and sin θ, provided Q is never equal to zero.

SECTION where P (cos θ, sin θ) and Q(cos θ, sin θ) are polynomials in cos θ and sin θ, provided Q is never equal to zero. SETION 6. 57 6. Evaluation of Dfinit Intgrals Exampl 6.6 W hav usd dfinit intgrals to valuat contour intgrals. It may com as a surpris to larn that contour intgrals and rsidus can b usd to valuat crtain

More information

4037 ADDITIONAL MATHEMATICS

4037 ADDITIONAL MATHEMATICS CAMBRIDGE INTERNATIONAL EXAMINATIONS GCE Ordinary Lvl MARK SCHEME for th Octobr/Novmbr 0 sris 40 ADDITIONAL MATHEMATICS 40/ Papr, maimum raw mark 80 This mark schm is publishd as an aid to tachrs and candidats,

More information

ECE602 Exam 1 April 5, You must show ALL of your work for full credit.

ECE602 Exam 1 April 5, You must show ALL of your work for full credit. ECE62 Exam April 5, 27 Nam: Solution Scor: / This xam is closd-book. You must show ALL of your work for full crdit. Plas rad th qustions carfully. Plas chck your answrs carfully. Calculators may NOT b

More information

CS 6353 Compiler Construction, Homework #1. 1. Write regular expressions for the following informally described languages:

CS 6353 Compiler Construction, Homework #1. 1. Write regular expressions for the following informally described languages: CS 6353 Compilr Construction, Homwork #1 1. Writ rgular xprssions for th following informally dscribd languags: a. All strings of 0 s and 1 s with th substring 01*1. Answr: (0 1)*01*1(0 1)* b. All strings

More information

Quasi-Classical States of the Simple Harmonic Oscillator

Quasi-Classical States of the Simple Harmonic Oscillator Quasi-Classical Stats of th Simpl Harmonic Oscillator (Draft Vrsion) Introduction: Why Look for Eignstats of th Annihilation Oprator? Excpt for th ground stat, th corrspondnc btwn th quantum nrgy ignstats

More information

u x v x dx u x v x v x u x dx d u x v x u x v x dx u x v x dx Integration by Parts Formula

u x v x dx u x v x v x u x dx d u x v x u x v x dx u x v x dx Integration by Parts Formula 7. Intgration by Parts Each drivativ formula givs ris to a corrsponding intgral formula, as w v sn many tims. Th drivativ product rul yilds a vry usful intgration tchniqu calld intgration by parts. Starting

More information

Differential Equations

Differential Equations Prfac Hr ar m onlin nots for m diffrntial quations cours that I tach hr at Lamar Univrsit. Dspit th fact that ths ar m class nots, th should b accssibl to anon wanting to larn how to solv diffrntial quations

More information

On spanning trees and cycles of multicolored point sets with few intersections

On spanning trees and cycles of multicolored point sets with few intersections On spanning trs and cycls of multicolord point sts with fw intrsctions M. Kano, C. Mrino, and J. Urrutia April, 00 Abstract Lt P 1,..., P k b a collction of disjoint point sts in R in gnral position. W

More information

Section 6.1. Question: 2. Let H be a subgroup of a group G. Then H operates on G by left multiplication. Describe the orbits for this operation.

Section 6.1. Question: 2. Let H be a subgroup of a group G. Then H operates on G by left multiplication. Describe the orbits for this operation. MAT 444 H Barclo Spring 004 Homwork 6 Solutions Sction 6 Lt H b a subgroup of a group G Thn H oprats on G by lft multiplication Dscrib th orbits for this opration Th orbits of G ar th right costs of H

More information

Observer Bias and Reliability By Xunchi Pu

Observer Bias and Reliability By Xunchi Pu Obsrvr Bias and Rliability By Xunchi Pu Introduction Clarly all masurmnts or obsrvations nd to b mad as accuratly as possibl and invstigators nd to pay carful attntion to chcking th rliability of thir

More information

MATH 319, WEEK 15: The Fundamental Matrix, Non-Homogeneous Systems of Differential Equations

MATH 319, WEEK 15: The Fundamental Matrix, Non-Homogeneous Systems of Differential Equations MATH 39, WEEK 5: Th Fundamntal Matrix, Non-Homognous Systms of Diffrntial Equations Fundamntal Matrics Considr th problm of dtrmining th particular solution for an nsmbl of initial conditions For instanc,

More information

On the irreducibility of some polynomials in two variables

On the irreducibility of some polynomials in two variables ACTA ARITHMETICA LXXXII.3 (1997) On th irrducibility of som polynomials in two variabls by B. Brindza and Á. Pintér (Dbrcn) To th mmory of Paul Erdős Lt f(x) and g(y ) b polynomials with intgral cofficints

More information

Estimation of apparent fraction defective: A mathematical approach

Estimation of apparent fraction defective: A mathematical approach Availabl onlin at www.plagiarsarchlibrary.com Plagia Rsarch Library Advancs in Applid Scinc Rsarch, 011, (): 84-89 ISSN: 0976-8610 CODEN (USA): AASRFC Estimation of apparnt fraction dfctiv: A mathmatical

More information

Week 3: Connected Subgraphs

Week 3: Connected Subgraphs Wk 3: Connctd Subgraphs Sptmbr 19, 2016 1 Connctd Graphs Path, Distanc: A path from a vrtx x to a vrtx y in a graph G is rfrrd to an xy-path. Lt X, Y V (G). An (X, Y )-path is an xy-path with x X and y

More information

What is a hereditary algebra?

What is a hereditary algebra? What is a hrditary algbra? (On Ext 2 and th vanishing of Ext 2 ) Claus Michal Ringl At th Münstr workshop 2011, thr short lcturs wr arrangd in th styl of th rgular column in th Notics of th AMS: What is?

More information

CPSC 665 : An Algorithmist s Toolkit Lecture 4 : 21 Jan Linear Programming

CPSC 665 : An Algorithmist s Toolkit Lecture 4 : 21 Jan Linear Programming CPSC 665 : An Algorithmist s Toolkit Lctur 4 : 21 Jan 2015 Lcturr: Sushant Sachdva Linar Programming Scrib: Rasmus Kyng 1. Introduction An optimization problm rquirs us to find th minimum or maximum) of

More information

4. (5a + b) 7 & x 1 = (3x 1)log 10 4 = log (M1) [4] d = 3 [4] T 2 = 5 + = 16 or or 16.

4. (5a + b) 7 & x 1 = (3x 1)log 10 4 = log (M1) [4] d = 3 [4] T 2 = 5 + = 16 or or 16. . 7 7 7... 7 7 (n )0 7 (M) 0(n ) 00 n (A) S ((7) 0(0)) (M) (7 00) 8897 (A). (5a b) 7 7... (5a)... (M) 7 5 5 (a b ) 5 5 a b (M)(A) So th cofficint is 75 (A) (C) [] S (7 7) (M) () 8897 (A) (C) [] 5. x.55

More information

EEO 401 Digital Signal Processing Prof. Mark Fowler

EEO 401 Digital Signal Processing Prof. Mark Fowler EEO 401 Digital Signal Procssing Prof. Mark Fowlr Dtails of th ot St #19 Rading Assignmnt: Sct. 7.1.2, 7.1.3, & 7.2 of Proakis & Manolakis Dfinition of th So Givn signal data points x[n] for n = 0,, -1

More information

Category Theory Approach to Fusion of Wavelet-Based Features

Category Theory Approach to Fusion of Wavelet-Based Features Catgory Thory Approach to Fusion of Wavlt-Basd Faturs Scott A. DLoach Air Forc Institut of Tchnology Dpartmnt of Elctrical and Computr Enginring Wright-Pattrson AFB, Ohio 45433 Scott.DLoach@afit.af.mil

More information

Elements of Statistical Thermodynamics

Elements of Statistical Thermodynamics 24 Elmnts of Statistical Thrmodynamics Statistical thrmodynamics is a branch of knowldg that has its own postulats and tchniqus. W do not attmpt to giv hr vn an introduction to th fild. In this chaptr,

More information

Searching Linked Lists. Perfect Skip List. Building a Skip List. Skip List Analysis (1) Assume the list is sorted, but is stored in a linked list.

Searching Linked Lists. Perfect Skip List. Building a Skip List. Skip List Analysis (1) Assume the list is sorted, but is stored in a linked list. 3 3 4 8 6 3 3 4 8 6 3 3 4 8 6 () (d) 3 Sarching Linkd Lists Sarching Linkd Lists Sarching Linkd Lists ssum th list is sortd, but is stord in a linkd list. an w us binary sarch? omparisons? Work? What if

More information

That is, we start with a general matrix: And end with a simpler matrix:

That is, we start with a general matrix: And end with a simpler matrix: DIAGON ALIZATION OF THE STR ESS TEN SOR INTRO DUCTIO N By th us of Cauchy s thorm w ar abl to rduc th numbr of strss componnts in th strss tnsor to only nin valus. An additional simplification of th strss

More information

Cramér-Rao Inequality: Let f(x; θ) be a probability density function with continuous parameter

Cramér-Rao Inequality: Let f(x; θ) be a probability density function with continuous parameter WHEN THE CRAMÉR-RAO INEQUALITY PROVIDES NO INFORMATION STEVEN J. MILLER Abstract. W invstigat a on-paramtr family of probability dnsitis (rlatd to th Parto distribution, which dscribs many natural phnomna)

More information

MCB137: Physical Biology of the Cell Spring 2017 Homework 6: Ligand binding and the MWC model of allostery (Due 3/23/17)

MCB137: Physical Biology of the Cell Spring 2017 Homework 6: Ligand binding and the MWC model of allostery (Due 3/23/17) MCB37: Physical Biology of th Cll Spring 207 Homwork 6: Ligand binding and th MWC modl of allostry (Du 3/23/7) Hrnan G. Garcia March 2, 207 Simpl rprssion In class, w drivd a mathmatical modl of how simpl

More information

What are those βs anyway? Understanding Design Matrix & Odds ratios

What are those βs anyway? Understanding Design Matrix & Odds ratios Ral paramtr stimat WILD 750 - Wildlif Population Analysis of 6 What ar thos βs anyway? Undrsting Dsign Matrix & Odds ratios Rfrncs Hosmr D.W.. Lmshow. 000. Applid logistic rgrssion. John Wily & ons Inc.

More information

Computing and Communications -- Network Coding

Computing and Communications -- Network Coding 89 90 98 00 Computing and Communications -- Ntwork Coding Dr. Zhiyong Chn Institut of Wirlss Communications Tchnology Shanghai Jiao Tong Univrsity China Lctur 5- Nov. 05 0 Classical Information Thory Sourc

More information

Problem Set #2 Due: Friday April 20, 2018 at 5 PM.

Problem Set #2 Due: Friday April 20, 2018 at 5 PM. 1 EE102B Spring 2018 Signal Procssing and Linar Systms II Goldsmith Problm St #2 Du: Friday April 20, 2018 at 5 PM. 1. Non-idal sampling and rcovry of idal sampls by discrt-tim filtring 30 pts) Considr

More information

perm4 A cnt 0 for for if A i 1 A i cnt cnt 1 cnt i j. j k. k l. i k. j l. i l

perm4 A cnt 0 for for if A i 1 A i cnt cnt 1 cnt i j. j k. k l. i k. j l. i l h 4D, 4th Rank, Antisytric nsor and th 4D Equivalnt to th Cross Product or Mor Fun with nsors!!! Richard R Shiffan Digital Graphics Assoc 8 Dunkirk Av LA, Ca 95 rrs@isidu his docunt dscribs th four dinsional

More information

Bifurcation Theory. , a stationary point, depends on the value of α. At certain values

Bifurcation Theory. , a stationary point, depends on the value of α. At certain values Dnamic Macroconomic Thor Prof. Thomas Lux Bifurcation Thor Bifurcation: qualitativ chang in th natur of th solution occurs if a paramtr passs through a critical point bifurcation or branch valu. Local

More information

Economics 201b Spring 2010 Solutions to Problem Set 3 John Zhu

Economics 201b Spring 2010 Solutions to Problem Set 3 John Zhu Economics 20b Spring 200 Solutions to Problm St 3 John Zhu. Not in th 200 vrsion of Profssor Andrson s ctur 4 Nots, th charactrization of th firm in a Robinson Cruso conomy is that it maximizs profit ovr

More information

Calculus concepts derivatives

Calculus concepts derivatives All rasonabl fforts hav bn mad to mak sur th nots ar accurat. Th author cannot b hld rsponsibl for any damags arising from th us of ths nots in any fashion. Calculus concpts drivativs Concpts involving

More information

Middle East Technical University Department of Mechanical Engineering ME 413 Introduction to Finite Element Analysis

Middle East Technical University Department of Mechanical Engineering ME 413 Introduction to Finite Element Analysis Middl East Tchnical Univrsity Dpartmnt of Mchanical Enginring ME 43 Introduction to Finit Elmnt Analysis Chaptr 3 Computr Implmntation of D FEM Ths nots ar prpard by Dr. Cünyt Srt http://www.m.mtu.du.tr/popl/cunyt

More information

On the Hamiltonian of a Multi-Electron Atom

On the Hamiltonian of a Multi-Electron Atom On th Hamiltonian of a Multi-Elctron Atom Austn Gronr Drxl Univrsity Philadlphia, PA Octobr 29, 2010 1 Introduction In this papr, w will xhibit th procss of achiving th Hamiltonian for an lctron gas. Making

More information

CE 530 Molecular Simulation

CE 530 Molecular Simulation CE 53 Molcular Simulation Lctur 8 Fr-nrgy calculations David A. Kofk Dpartmnt of Chmical Enginring SUNY Buffalo kofk@ng.buffalo.du 2 Fr-Enrgy Calculations Uss of fr nrgy Phas quilibria Raction quilibria

More information

Probability Translation Guide

Probability Translation Guide Quick Guid to Translation for th inbuilt SWARM Calculator If you s information looking lik this: Us this statmnt or any variant* (not th backticks) And this is what you ll s whn you prss Calculat Th chancs

More information

Recall that by Theorems 10.3 and 10.4 together provide us the estimate o(n2 ), S(q) q 9, q=1

Recall that by Theorems 10.3 and 10.4 together provide us the estimate o(n2 ), S(q) q 9, q=1 Chaptr 11 Th singular sris Rcall that by Thorms 10 and 104 togthr provid us th stimat 9 4 n 2 111 Rn = SnΓ 2 + on2, whr th singular sris Sn was dfind in Chaptr 10 as Sn = q=1 Sq q 9, with Sq = 1 a q gcda,q=1

More information

From Elimination to Belief Propagation

From Elimination to Belief Propagation School of omputr Scinc Th lif Propagation (Sum-Product lgorithm Probabilistic Graphical Modls (10-708 Lctur 5, Sp 31, 2007 Rcptor Kinas Rcptor Kinas Kinas X 5 ric Xing Gn G T X 6 X 7 Gn H X 8 Rading: J-hap

More information

Forces. Quantum ElectroDynamics. α = = We have now:

Forces. Quantum ElectroDynamics. α = = We have now: W hav now: Forcs Considrd th gnral proprtis of forcs mdiatd by xchang (Yukawa potntial); Examind consrvation laws which ar obyd by (som) forcs. W will nxt look at thr forcs in mor dtail: Elctromagntic

More information

2.3 Matrix Formulation

2.3 Matrix Formulation 23 Matrix Formulation 43 A mor complicatd xampl ariss for a nonlinar systm of diffrntial quations Considr th following xampl Exampl 23 x y + x( x 2 y 2 y x + y( x 2 y 2 (233 Transforming to polar coordinats,

More information

3 Finite Element Parametric Geometry

3 Finite Element Parametric Geometry 3 Finit Elmnt Paramtric Gomtry 3. Introduction Th intgral of a matrix is th matrix containing th intgral of ach and vry on of its original componnts. Practical finit lmnt analysis rquirs intgrating matrics,

More information

Coupled Pendulums. Two normal modes.

Coupled Pendulums. Two normal modes. Tim Dpndnt Two Stat Problm Coupld Pndulums Wak spring Two normal mods. No friction. No air rsistanc. Prfct Spring Start Swinging Som tim latr - swings with full amplitud. stationary M +n L M +m Elctron

More information

Limiting value of higher Mahler measure

Limiting value of higher Mahler measure Limiting valu of highr Mahlr masur Arunabha Biswas a, Chris Monico a, a Dpartmnt of Mathmatics & Statistics, Txas Tch Univrsity, Lubbock, TX 7949, USA Abstract W considr th k-highr Mahlr masur m k P )

More information

Symmetric centrosymmetric matrix vector multiplication

Symmetric centrosymmetric matrix vector multiplication Linar Algbra and its Applications 320 (2000) 193 198 www.lsvir.com/locat/laa Symmtric cntrosymmtric matrix vctor multiplication A. Mlman 1 Dpartmnt of Mathmatics, Univrsity of San Francisco, San Francisco,

More information

2013 Specialist Mathematics GA 3: Written examination 2

2013 Specialist Mathematics GA 3: Written examination 2 0 0 Spcialist Mathmatics GA : Writtn xamination GENERAL COMMENTS Th 0 Spcialist Mathmatics xamination comprisd multipl-choic qustions (worth marks) and fiv xtndd qustions (worth 8 marks). Th papr smd accssibl

More information

Thus, because if either [G : H] or [H : K] is infinite, then [G : K] is infinite, then [G : K] = [G : H][H : K] for all infinite cases.

Thus, because if either [G : H] or [H : K] is infinite, then [G : K] is infinite, then [G : K] = [G : H][H : K] for all infinite cases. Homwork 5 M 373K Solutions Mark Lindbrg and Travis Schdlr 1. Prov that th ring Z/mZ (for m 0) is a fild if and only if m is prim. ( ) Proof by Contrapositiv: Hr, thr ar thr cass for m not prim. m 0: Whn

More information

Some remarks on Kurepa s left factorial

Some remarks on Kurepa s left factorial Som rmarks on Kurpa s lft factorial arxiv:math/0410477v1 [math.nt] 21 Oct 2004 Brnd C. Kllnr Abstract W stablish a connction btwn th subfactorial function S(n) and th lft factorial function of Kurpa K(n).

More information

Mor Tutorial at www.dumblittldoctor.com Work th problms without a calculator, but us a calculator to chck rsults. And try diffrntiating your answrs in part III as a usful chck. I. Applications of Intgration

More information

Function Spaces. a x 3. (Letting x = 1 =)) a(0) + b + c (1) = 0. Row reducing the matrix. b 1. e 4 3. e 9. >: (x = 1 =)) a(0) + b + c (1) = 0

Function Spaces. a x 3. (Letting x = 1 =)) a(0) + b + c (1) = 0. Row reducing the matrix. b 1. e 4 3. e 9. >: (x = 1 =)) a(0) + b + c (1) = 0 unction Spacs Prrquisit: Sction 4.7, Coordinatization n this sction, w apply th tchniqus of Chaptr 4 to vctor spacs whos lmnts ar functions. Th vctor spacs P n and P ar familiar xampls of such spacs. Othr

More information

Equidistribution and Weyl s criterion

Equidistribution and Weyl s criterion Euidistribution and Wyl s critrion by Brad Hannigan-Daly W introduc th ida of a sunc of numbrs bing uidistributd (mod ), and w stat and prov a thorm of Hrmann Wyl which charactrizs such suncs. W also discuss

More information

Principles of Humidity Dalton s law

Principles of Humidity Dalton s law Principls of Humidity Dalton s law Air is a mixtur of diffrnt gass. Th main gas componnts ar: Gas componnt volum [%] wight [%] Nitrogn N 2 78,03 75,47 Oxygn O 2 20,99 23,20 Argon Ar 0,93 1,28 Carbon dioxid

More information

surface of a dielectric-metal interface. It is commonly used today for discovering the ways in

surface of a dielectric-metal interface. It is commonly used today for discovering the ways in Surfac plasmon rsonanc is snsitiv mchanism for obsrving slight changs nar th surfac of a dilctric-mtal intrfac. It is commonl usd toda for discovring th was in which protins intract with thir nvironmnt,

More information

Sundials and Linear Algebra

Sundials and Linear Algebra Sundials and Linar Algbra M. Scot Swan July 2, 25 Most txts on crating sundials ar dirctd towards thos who ar solly intrstd in making and using sundials and usually assums minimal mathmatical background.

More information

GEOMETRICAL PHENOMENA IN THE PHYSICS OF SUBATOMIC PARTICLES. Eduard N. Klenov* Rostov-on-Don, Russia

GEOMETRICAL PHENOMENA IN THE PHYSICS OF SUBATOMIC PARTICLES. Eduard N. Klenov* Rostov-on-Don, Russia GEOMETRICAL PHENOMENA IN THE PHYSICS OF SUBATOMIC PARTICLES Eduard N. Klnov* Rostov-on-Don, Russia Th articl considrs phnomnal gomtry figurs bing th carrirs of valu spctra for th pairs of th rmaining additiv

More information

NEW APPLICATIONS OF THE ABEL-LIOUVILLE FORMULA

NEW APPLICATIONS OF THE ABEL-LIOUVILLE FORMULA NE APPLICATIONS OF THE ABEL-LIOUVILLE FORMULA Mirca I CÎRNU Ph Dp o Mathmatics III Faculty o Applid Scincs Univrsity Polithnica o Bucharst Cirnumirca @yahoocom Abstract In a rcnt papr [] 5 th indinit intgrals

More information

5.80 Small-Molecule Spectroscopy and Dynamics

5.80 Small-Molecule Spectroscopy and Dynamics MIT OpnCoursWar http://ocw.mit.du 5.80 Small-Molcul Spctroscopy and Dynamics Fall 008 For information about citing ths matrials or our Trms of Us, visit: http://ocw.mit.du/trms. Lctur # 3 Supplmnt Contnts

More information

CHAPTER 1. Introductory Concepts Elements of Vector Analysis Newton s Laws Units The basis of Newtonian Mechanics D Alembert s Principle

CHAPTER 1. Introductory Concepts Elements of Vector Analysis Newton s Laws Units The basis of Newtonian Mechanics D Alembert s Principle CHPTER 1 Introductory Concpts Elmnts of Vctor nalysis Nwton s Laws Units Th basis of Nwtonian Mchanics D lmbrt s Principl 1 Scinc of Mchanics: It is concrnd with th motion of matrial bodis. odis hav diffrnt

More information

Hydrogen Atom and One Electron Ions

Hydrogen Atom and One Electron Ions Hydrogn Atom and On Elctron Ions Th Schrödingr quation for this two-body problm starts out th sam as th gnral two-body Schrödingr quation. First w sparat out th motion of th cntr of mass. Th intrnal potntial

More information

Separating principles below Ramsey s Theorem for Pairs

Separating principles below Ramsey s Theorem for Pairs Sparating principls blow Ramsy s Thorm for Pairs Manul Lrman, Rd Solomon, Hnry Towsnr Fbruary 4, 2013 1 Introduction In rcnt yars, thr has bn a substantial amount of work in rvrs mathmatics concrning natural

More information

INTEGRATION BY PARTS

INTEGRATION BY PARTS Mathmatics Rvision Guids Intgration by Parts Pag of 7 MK HOME TUITION Mathmatics Rvision Guids Lvl: AS / A Lvl AQA : C Edcl: C OCR: C OCR MEI: C INTEGRATION BY PARTS Vrsion : Dat: --5 Eampls - 6 ar copyrightd

More information

The Equitable Dominating Graph

The Equitable Dominating Graph Intrnational Journal of Enginring Rsarch and Tchnology. ISSN 0974-3154 Volum 8, Numbr 1 (015), pp. 35-4 Intrnational Rsarch Publication Hous http://www.irphous.com Th Equitabl Dominating Graph P.N. Vinay

More information

Problem Set 6 Solutions

Problem Set 6 Solutions 6.04/18.06J Mathmatics for Computr Scinc March 15, 005 Srini Dvadas and Eric Lhman Problm St 6 Solutions Du: Monday, March 8 at 9 PM in Room 3-044 Problm 1. Sammy th Shark is a financial srvic providr

More information

Solution of Assignment #2

Solution of Assignment #2 olution of Assignmnt #2 Instructor: Alirza imchi Qustion #: For simplicity, assum that th distribution function of T is continuous. Th distribution function of R is: F R ( r = P( R r = P( log ( T r = P(log

More information

CO-ORDINATION OF FAST NUMERICAL RELAYS AND CURRENT TRANSFORMERS OVERDIMENSIONING FACTORS AND INFLUENCING PARAMETERS

CO-ORDINATION OF FAST NUMERICAL RELAYS AND CURRENT TRANSFORMERS OVERDIMENSIONING FACTORS AND INFLUENCING PARAMETERS CO-ORDINATION OF FAST NUMERICAL RELAYS AND CURRENT TRANSFORMERS OVERDIMENSIONING FACTORS AND INFLUENCING PARAMETERS Stig Holst ABB Automation Products Swdn Bapuji S Palki ABB Utilitis India This papr rports

More information

There is an arbitrary overall complex phase that could be added to A, but since this makes no difference we set it to zero and choose A real.

There is an arbitrary overall complex phase that could be added to A, but since this makes no difference we set it to zero and choose A real. Midtrm #, Physics 37A, Spring 07. Writ your rsponss blow or on xtra pags. Show your work, and tak car to xplain what you ar doing; partial crdit will b givn for incomplt answrs that dmonstrat som concptual

More information