Coherence for Qualiied Types
نویسنده
چکیده
ions and let expressions. Any such renaming is permitted so long as we avoid clashes with free variables. The nal group of structural rules in Figure 5 is closely modeled on the typing rules for OP and can be used to describe the reduction of subterms within a given term. 3.3 Equalities between terms The rules in Figure 6 de ne the equality relation for terms in OP as the transitive, symmetric closure of the reduction relation described above. The rst two rules ensure that P jA ` E = F : P jA ` F = E : P jA ` E = E 0 : P jA ` E 0 = E 00 : P jA ` E = E 00 : P jA ` E > F : P jA ` E = F : Figure 6: De nition of equality between terms. equality is an equivalence relation. There is no need to include re exivity here since this is a direct consequence of the structural rules in Figure 5. The last rule shows how reductions give rise to equalities. In practice, many of the rules used in the de nition of equality above will be used implicitly in the proof of equalities between terms. The following example uses all three of the rules in Figure 6 (as well as subject reduction to justify the fact that the intermediate steps are well-typed): P jA ` let x = E in [F=x ]F 0 = [E=x ]([F=x ]F 0) ( -let) = [[E=x ]F=x ]F 0 = let x = [E=x ]F in F 0 : ( -let) The context in which this equality is established (given by P , A and ) does not play a part in the calculation. Examples like this are quite common and we will often avoid mentioning the context altogether in such situations, writing ` E = F to indicate that P j A ` E = F : for any choice of P , A and for which the required side conditions hold. The above property of let expressions may seem unfamiliar, and it is worth illustrating why it is useful in our work. Suppose that ; `̀ e : Eq Int and that (==) denotes an equality function of type 8a:Eq a ) a ! a ! Bool . Now consider the OML term: let f = ( x : y:x == y) in f 2 3: Since the function f is only ever applied to integer values, it is su cient to treat f as having type Int ! Int ! Bool , with translation: let f = ( x : y:(==) e x y) in f 2 3 However, the type inference algorithm calculates the type of f as 8a:Eq a ) a ! a ! Bool and results in a translation of the form: let f = ( v : x : y:(==) v x y) in f e 2 3: The following calculation shows that these translations are equal and hence that it is possible to eliminate the evidence abstraction used in the second case. The second step is justi ed by the result above. ` let f = ( v : x : y:(==) v x y) in f e 2 3 = let f = ( v : x : y:(==) v x y) in [f e=f ](f 2 3) = let f = [ v : x : y:(==) v x y=f ](f e) in f 2 3 = let f = ( v : x : y:(==) v x y) e in f 2 3 = let f = ( x : y:(==) e x y) in f 2 3 As in the last step here, many equalities between terms can be obtained by replacing one subterm with an equivalent term. These steps are justi ed by the structural rules in Figure 5 and are often used implicitly in proofs. 4 Conversions One of the most important tools in the treatment of type inference is the ordering relation used to describe when one (constrained) type scheme is more general than another. For example, assuming that ; `̀ e :Eq Int , the ordering: (8a:Eq a ) a ! a ! Bool) (Int ! Int ! Bool) might be used to justify replacing an integer equality function, say primEqInt :: Int!Int!Bool with a generic equality function with the more general type 8a:Eq a)a!a! Bool as in the previous section. This breaks down in OP due to the presence of evidence abstraction and application: simply replacing primEqInt with (==) in primEqInt 2 3 does not even give a well-typed expression! The correct approach is to replace primEqInt by (==) e. More generally, we will deal with examples like this using OP terms as an interpretation of the ordering between type schemes. For each 0 we identify a particular collection of terms that we call conversions from to 0. Each such conversion is a closed OP term C : ! 0 and hence any term of type can be treated as having type 0 by applying the conversion C to it. One possible conversion for the example above is: ( x :xe) : (8a:Eq a )a!a!Bool)!(Int!Int!Bool): Note that the type of this conversion (as in the general case) cannot be expressed as an OML type scheme since it uses the richer structure of OP types. For the purposes of type inference it would be su cient to take any term C of type ! 0 as a conversion for 0 but this is clearly inadequate if we are also concerned with the semantics of the terms involved; we can only replace E with CE if we can guarantee that these terms are equivalent, except perhaps in their use of evidence abstraction and application. More formally, we need to ensure that ` Erase (CE) = Erase E for all OP terms E (or at least, all those occurring as translations of OML terms). Since Erase (CE) = (Erase C ) (Erase E), the obvious way to 6 ensure that this condition holds is to require that Erase C is equivalent to the identity term id = x :x . These ideas extend to conversions between arbitrary constrained type schemes. It is tempting to de ne the set of conversions from (P 0 j 0) to (P j ) as the set of all closed OP terms C : (P j ) ! (P 0 j 0) for which Erase C is equivalent to id . In practice it is more convenient to choose a more conservative de nition that gives more information about the structure of conversions: De nition 3 Suppose = (8 i :Q ) ), 0 = (8 j :Q 0 ) 0) and none of j appear free in , P or P 0. A conversion C from (P j ) to (P 0 j 0), written C : (P j ) (P 0 j 0), is a closed OP term of type (P j )! (P 0 j 0) such that: Erase C = id, v :P 0;w :Q 0 `̀ e :P ; f : [ i= i ]Q, 0 = [ i= i ] , and ` C = x : v : w :xef for some types i , evidence variables v and evidence e. It is straightforward to verify that the term x : v : w :xef mentioned in this de nition is a conversion from (P j ) to (P 0 j 0) and it follows that any equivalent OP term with the same type will also be a conversion of the same kind. On the other hand, we cannot assume that all such conversions will be equivalent to this particular term since there may be more than one choice for the types i and hence for the evidence expressions f in the de nition above. It is immediate from the de nitions above that (P j ) (P 0 j 0) if and only if there is a conversion C : (P j ) (P 0 j 0) (this may require renaming the bound variables of 0 to apply the de nition of conversions). As a result, all of the properties of the ( ) ordering described in [7] can be extended to analogous results for conversions. For example, the following proposition shows that re exivity of ( ) corresponds to the identity conversion while transitivity of ( ) corresponds to composition of conversions. Proposition 1 For any (P j ) there is a conversion id : (P j ) (P j ). Furthermore, if C : (P j ) (P 0 j 0) and C 0 : (P 0 j 0) (P 00 j 00), then (C 0 C ) : (P j ) (P 00 j 00) where (C 0 C ) x :C 0(Cx ). From a categorical perspective, this proposition can be used to show that there is a category whose objects are type schemes and whose arrows are (equivalence classes of) conversions. The only additional properties needed to justify this are that the composition of equivalence classes is wellde ned and associative, both of which are easily veri ed. The ordering relation ( ) is preserved by substitutions and the corresponding result for conversions is: Proposition 2 If C : (P j ) (P 0 j 0) and S is a substitution of types for type variables, then C :S(P j ) S(P 0 j 0). The ordering between type schemes extends to an ordering between (constrained) type assignments, writing (P jA) (P 0 jA0) to indicate that (P jA(x )) (P 0 jA0(x )) for each x 2 dom A = dom A0. It is useful to extend the de nition of conversions to orderings between type assignments. For the purposes of this work, it is su cient to consider only the case of orderings of the form A A0 and A (P jA0), the rst of which is just a special case of the second with P = ;. One simple approach would be to de ne a conversion for an ordering A (P jA0) as a function that gives a conversion from A(x ) to (P j A0(x )) for each x 2 dom A. However, whereas we might use a conversion C : (P j 0) to treat a term of type as having type 0, we will typically use a conversion between type assignments to simultaneously replace each occurrence of a variables mentioned in the type assignment with an appropriate new term. From this perspective it seems more sensible to think of a conversion between type assignments as a term substitution. Furthermore, the translations of a term are calculated with respect to a particular predicate assignment (the rst component in a derivation v : P j A ` E ; E 0 : ) and may involve the evidence variables in the domain of that assignment. It is therefore necessary to specify these variables explicitly as part of the type of the conversion. De nition 4 A conversion C from a type assignment A to a constrained type assignment (v : P j A0) with the same domain, written C :A (v : P jA0), is a substitution such that: dom C dom A = dom A0. In particular, if x 62 dom A, then Cx x . ( x : v :Cx ) :A(x ) (P jA0(x )) for each x 2 dom A. Note that the expression Cx in this de nition denotes an application of a (meta-language) substitution to a particular variable; C is not an OP term. Continuing with the previous example and assuming that ; `̀ e :Eq Int , one possible conversion for the type assignment ordering f(==) : Int ! Int ! Boolg f(==) : 8a:Eq a ) a ! a ! Boolg would be the substitution that maps (==) to (==) e and xes every other variable. To see how this might be used, consider an OP term in which the (==) has been treated as having type Int ! Int ! Bool . If we replace this with a generic equality function with the more general type, then we need to include the evidence e for Eq Int with every use of (==). This is precisely the e ect obtained by applying the conversion to the original term. 5 Syntax-directed translation The next two sections follow the development of [7] to describe the relationship between an arbitrary translation of an OML term and a particular translation determined by the type inference algorithm. For reasons of space, we will only sketch the details here and refer the reader to [8] for further explanation and motivation. The rules in Figure 2 are not well-suited to use in a type inference algorithm since it is not always clear which (if any) should be used to obtain an optimal (i.e. principal) typing for a given term. Our solution is to work with the set of typing rules in Figure 7 in which the structure of a derivation P jA s̀ E ; E 0 : is uniquely determined by the syntactic structure of the OML term E and to show that this syntaxdirected approach is equivalent to the original type system. 7 (var)s (x : (8 i :Q ) )) 2 A P `̀ e : [ i= i ]Q P jA s̀ x ; xe : [ i= i ] (!E)s P jA s̀ E ; E 0 : 0 ! P jA s̀ F ; F 0 : 0 P jA s̀ EF ; E 0F 0 : (!I )s P jAx ; x : 0 s̀ E ; E 0 : P jA s̀ x :E ; x :E 0 : 0 ! (let)s v 0 :P 0 jA s̀ E ; E 0 : 0 P jAx ; x : 0 s̀ F ; F 0 : 0 = Gen(A;P 0 ) 0) P jA s̀ (let x = E in F ); (let x = v 0:E 0 in F 0) : Figure 7: Syntax-directed typing rules with translation Note that the OP translation for a given OML term need not be uniquely determined since there may be distinct choices for the evidence values e introduced in (var)s . This, of course, is the source of the incoherence in the translation semantics of OML. A simple proof by induction establishes the soundness of the syntax-directed rules with respect to those in Figure 2. Theorem 1 If P jA s̀ E;E 0 : , then P jA`E;E 0 : . The reverse process, to establish a form of completeness property by showing that every translation and typing obtained using the general rules in Figure 2 can, in some sense, be described by a syntax-directed derivation is less obvious. For example, if P j A ` E ; F : , then it will not in general be possible to derive the same typing in the syntaxdirected system because is a type scheme, not a simple type. However, for any v 0 :P 0 jA s̀ E ; F 0 : , Theorem 1 shows that v 0 :P 0 jA ` E ; F 0 : , and the most general typing that can be obtained from this using ()I ) and (8I ) is ;jA ` E ; v 0:F 0 : Gen(A;P 0 ) ) where: Gen(A; ) = 8(TV ( ) nTV (A)): : The following theorem shows that it is always possible to nd a derivation in this way such that the inferred type scheme Gen(A;P 0 ) 0) is more general than the constrained type scheme (P j ) in the original derivation and that the translations are related by the corresponding conversion. Theorem 2 If v : P j A ` E ; E 0 : , then there is a predicate assignment v 0 :P 0, a type 0 and a term E 00 such that v 0 :P 0 jA s̀ E ; E 00 : 0 and v :P jA ` C ( v 0:E 00)v = E 0 : for some conversion C :Gen(A;P 0 ) 0) (P j ). The proof (by structural induction) is quite complicated and makes use of several results which are of interest in their own right. In particular, if we assume that v :P jA s̀ E ; E 0 : , then: SP jSA s̀ E ; E 0 : S for any substitution S . If Q `̀ e :P , then Q jA s̀ E ; [e=v ]E 0 : . If C :A0 (v :P jA), then v :P jA0 s̀ E ; E 00 : and v :P jA0 ` CE 0 = E 00 : . Each of these extends earlier results described in [7]. 6 Type inference and translation Figure 8 gives the rules necessary to extend the type inference algorithm from [7] to include the calculation of a translation. These rules can be interpreted as an attribute grammar in which the type assignment A and OML term E in a judgement of the form P j TA Ẁ E ; E 0 : are inherited attributes, while the predicate assignment P , substitution T , OP translation E 0 and type are synthesized. Any typing and translation that is obtained using the type inference algorithm can be derived in the syntax-directed system: Theorem 3 If P jTA Ẁ E;E 0 : , then P jTA s̀ E;E 0 : . Combining this with Theorem 1 we obtain: Corollary 1 If P jTA Ẁ E;E 0 : , then P jTA`E;E 0 : . This is important because it shows that the `translation' E 0 of an OML term E produced by the algorithm above is a valid translation of E and, in particular, that it is a welltyped OP term. We will refer to the translations produced by this algorithm as principal translations. The following theorem provides strong motivation for this terminology, showing that every translation obtained using the syntaxdirected system can be expressed in terms of a principal translation. Theorem 4 If v:PjSA s̀E;E 0: , then w:QjTA ẀE;E 00 : and there is a substitution R such that = R , v:P `̀ e:RQ, v :P jSA ` E 0 = [e=w ]E 00 : and S RT. The notation S RT used here means that S = RT for all but a nite number of new type variables . Theorem 4 can now be used to describe the relationship between arbitrary translations of an OML term and a principal translation: Corollary 2 Ifv:PjSA`E;E 0 : , thenw:QjTA Ẁ E;E 00 : for some w :Q, T, E 00 and and there is a substitution R and a conversion C :RGen(TA;Q ) ) (P j ) such that S RT and v :P jSA ` C ( w :E 00)v = E 0 : . 8 (var)W(x :8 i :P ) ) 2 Ai and v newv : [ i= i ]P jA Ẁ x ; xv : [ i= i ](!E)W P jTA Ẁ E ; E 0 :Q jT 0TA Ẁ F ; F 0 : 0T 0 U0 !newU (T 0P ;Q) jUT 0TA Ẁ EF ; E 0F 0 : U(!I )WP jT (Ax ; x : ) Ẁ E ; E 0 :newP jTA Ẁ x :E ; x :E 0 : T !(let)W v :P jTA Ẁ E ; E 0 :P 0 jT0(TAx ; x : ) Ẁ F ; F 0 : 0= Gen(TA;P ) )P 0 jT 0TA Ẁ (let x = E in F ); (let x = v :E 0 in F ) : 0Figure 8: Type inference algorithm with translation7 Coherence resultsCorollary 2 is important because it shows that any transla-tion of an OML term E in a particular context can be writ-ten in the form C ( w :E 0)v where E 0 is a principal trans-lation and C is the corresponding conversion. Applied totwo arbitrary derivations v : P j A ` E ; E 01 : andv :P jA ` E ; E 02 : , it follows that:v :P jA ` E 01 = C1( w :E 0)v : andv :P jA ` E 02 = C2( w :E 0)v :where C1 and C2 are conversions from the principal typescheme to (P j ). One obvious way to ensure that thesetranslations are equal is to show that C1 = C2.7.1 Equality of conversionsTaking a slightly more general view, suppose that C1, C2 areconversions from to (P 0 j 0). Without loss of generality, wecan assume that = (8 i :Q ) ) and0 = (80j :Q 0 ) 0)where the variables0j only appear in (Q 0 ) 0). Using thede nition of conversions, it follows that there are types isuch that 0 = [ i= i ] , C1 = x : v 0: w 0:xef andv 0 :P 0;w 0 :Q 0 `̀ e :P ; f : [ i= i ]Q:Similarly for C2 there are types 0i such that 0 = [ 0i= i ] ,C2 = x : v 0: w 0:xe 0f 0 andv 0 :P 0;w 0 :Q 0 `̀ e 0 :P ; f 0 : [ 0i= i ]Q:Clearly, it is su cient to show e = e 0 and f = f 0 to provethat the these two conversions are equivalent. The rstequality is an immediate consequence of the uniqueness ofevidence; both e and e 0 are evidence for the predicates Punder the evidence assignment v 0 : P 0;w 0 :Q 0 and so mustbe equal. The same argument cannot applied to the secondequality since the predicates [ i= i ]Q may not be the sameas those in [ 0i= i ]Q due to di erences between i and0i .Nevertheless, [ i= i ] =0 = [ 0i= i ] , and so i =0i forall i 2 TV ( ). Hence if f ig \ TV (Q) TV ( ), thenthe two predicate sets [ i= i ]Q and [ 0i= i ]Q will be equaland f = f 0 as required. We will give a special name to typeschemes with this property:De nition 5 A type scheme = 8 i :Q ) is unambigu-ous if f ig \TV (Q) TV ( ).The same concept of unambiguous type schemes is used inHaskell, motivating our use of the term here. The discussionabove shows that all conversions from an unambiguous typescheme are equivalent:Proposition 3 If C1; C2 : (P 0 j 0) are conversions andis an unambiguous type scheme then C1 = C2.7.2 Equality of translationsAs an immediate corollary, it follows that, if the principaltype scheme for a term E is unambiguous, then any twotranslations of E must be equivalent:Theorem 5 If v : P j A ` E ; E 01 : and v : P j A `E ; E 02 : and the principal type scheme of E in A isunambiguous, then v :P jA ` E 01 = E 02 : .This generalizes an earlier result by Blott [1] for the specialcase of the type system in [13].Theorem 5 is easy to work with in concrete implementations.The rst step in type-checking an OML program is to usethe type inference algorithm to calculate its principal typeand translation. If the program does not have a principaltype, then it cannot be well-typed and will be rejected. Ifthe principal type is not unambiguous, then we cannot guar-antee a well-de ned semantics and the program must againbe rejected. For example, the principal type scheme of theterm out (in x ) in the example in Section 2 is 8a:C a ) Intwhich is ambiguous and hence the program will not be ac-cepted.Note that Theorem 5 gives a condition that is su cient, butnot necessary, to guarantee coherence. For example, anyattempt to compare the empty list with itself in Haskell byevaluating [] == [] leads to an error since this term has anambiguous principal type Eq [a] => Bool, even though itshould evaluate to True for any choice of the type variablea. On the other hand, this cannot be established using thede nition of equality in Section 3 and we might conjecturethat the restriction to terms with unambiguous principaltypes is both necessary and su cient to guarantee coherencewith respect to that formulation of provable equality.9 8 Related workA number of researchers have investigated the coherenceproperties of particular type systems using a process of nor-malization of typing derivations. Examples of this includesystems with explicit subtyping [2, 3], a form of implicit sub-typing called scaling [12] and an earlier treatment of typeclasses [1]. The basic idea in each case is to give a col-lection of reduction rules and prove that they are con uent,that they preserve meaning and that any reduction sequenceterminates (and hence, that the rules are strongly normaliz-ing). The con uence property guarantees the existence of aunique normal form and the fact that meaning is preservedby reduction is then su cient to guarantee coherence.In the work described in this paper, the rules for reductionsbetween terms in Section 3.2 correspond to reductions be-tween derivations and the formulation of the syntax-directedsystem can be thought of as a means of identifying the `nor-mal forms' of a derivation. From this perspective, Theorem 2can be interpreted as a proof that the reduction process ter-minates and that it preserves meaning. However, havingshown that the coherence property does not hold in the gen-eral case (Section 2) we do not guarantee the existence ofunique normal forms or con uence.The most important and novel feature of our work is the useof conversions to give a semantic interpretation to to order-ing between constrained type schemes. In e ect, a conver-sion acts as a record of the way in which one derivation isreduced to another. Some of this information is lost becausewe do not distinguish between conversions that are provablyequal but, as we have seen, we retain su cient detail to es-tablish useful conditions that guarantee coherence.Our use of conversions is closely related to Mitchell's useof retyping functions in [9] to give minimal typings for arestricted set of terms in a version of the pure polymorphic-calculus. The exibility of the language of types in thesystems considered by Mitchell (essentially the same as thosein OP but without quali ed types) is largely responsible forthe di culty of extending this to a larger collection of terms.These problems have been avoided here by working withthe OML type system which is based on a more restrictedcollection of type schemes.One of the biggest limitations of our work is caused by thedecision to include -reduction in the de nition of equality(Section 3.2). As an immediate consequence, the results inthis paper cannot be applied to languages with call-by-valuesemantics. The same problem occurs in other work, includ-ing the coherence proof in [1]. One possibility would be torework these results using an axiomatization of equality forcall-by-value semantics such as that given by Riecke [11],but it would clearly be preferable to nd a single formula-tion that can be used for both cases.Another promising approach would be to use ideas from cat-egory theory as in [10] for a language with intersection typesand subtyping, and in [5] for a system of type classes. Oneof the main attractions of the categorical approach from thetheoretical standpoint is the increased generality resultingfrom a higher level of abstraction. The main bene t forpractical work is likely to be the `variable-free' approachwhich avoids some of the messy technical details involvingfree and bound variables. As mentioned in Section 4, ourtreatment of conversions has a strong categorical avour andwe would hope to be able to extend the techniques devel-oped here to provide a more general treatment of coherencefor quali ed types.References[1] S.M. Blott. An approach to overloading with polymor-phism. Ph.D. thesis, Department of computing science,University of Glasgow, July 1991 (draft version).[2] V. Breazu-Tannen, T. Coquand, C.A. Gunter and A.Scedrov. Inheritance and coercion. In IEEE Symposiumon Logic in Computer Science, 1989.[3] P.-L. Curien and G. Ghelli. Coherence of subsumption.In Fifteenth Colloquium on Trees in Algebra and Pro-gramming. Springer Verlag LNCS 431, 1990.[4] L. Damas and R. Milner. Principal type schemes forfunctional programs. In 8th Annual ACM Symposiumon Principles of Programming languages, 1982.[5] B. Hilken and D. Rhydeheard. Towards a categoricalsemantics of type classes. In Theoretical aspects of com-puter software. Springer Verlag LNCS 526, 1991.[6] P. Hudak, S.L. Peyton Jones and P. Wadler (eds.). Re-port on the programming language Haskell, version 1.2.ACM SIGPLAN notices, 27, 5, May 1992.[7] M.P. Jones. A theory of quali ed types. In Europeansymposium on programming. Springer Verlag LNCS582, 1992.[8] M.P. Jones. Quali ed types: Theory and Practice. D.Phil. Thesis. Programming Research Group, OxfordUniversity Computing Laboratory. July 1992.[9] J.C. Mitchell, Polymorphic type inference and contain-ment. In G. Huet (ed.), Logical Foundations of Func-tional Programming, Addison Wesley, 1990.[10] J.C. Reynolds. The coherence of languages with inter-section types. In Theoretical aspects of computer soft-ware. Springer Verlag LNCS 526, 1991.[11] J.G. Riecke. A complete and decidable proof systemfor call-by-value equalities (preliminary report). In 17thInternational Colloquium on Automata, Languages andProgramming. Springer Verlag LNCS 443, 1990.[12] S. Thatte. Type inference and implicit scaling. In Eu-ropean Symposium on Programming. Springer VerlagLNCS 432, 1990.[13] P. Wadler and S. Blott. How to make ad-hoc polymor-phism less ad-hoc. In ACM Principles of ProgrammingLanguages, 1989.10
منابع مشابه
Ml Typing, Explicit Polymorphism and Qualiied Types
The ML type system was originally introduced as a means of identifying a class of terms in a simple untyped language, often referred to as core-ML, whose evaluation could be guaranteed not to \go wrong". In subsequent work, the terms of core-ML have also been viewed as a `con-venient shorthand' for programs in typed languages. Notable examples include studies of ML polymorphism and investigatio...
متن کاملReasoning About Action II: The Qualification Problem
We present a computationally eeective approach to representing and reasoning about actions with many qualiications. The approach involves treating actions as qualiied not by speciic facts that may or may not hold when the action is executed, but instead as potentially qualiied by general constraints describing the domain being investigated. Speciically, we suggest that the result of the action ...
متن کاملSecret Sharing Schemes with Veto Capabilities
A secret sharing scheme permits a secret to be shared among participants in such a way that only qualiied subsets of participants can recover the secret, but any non-qualiied subset has absolutely no information on the secret. In this paper we consider the problem of designing eecient secret sharing schemes having the additional feature that qualiied minorities can forbid any other set of parti...
متن کاملUse of Cohesive Ties in English as a Foreign Language Students’ Writing
This study aims to understand certain linguistic and semantic resources for the text construction, namely the constructs of cohesion, coherence. The analysis of cohesive ties was conducted on the writing samples of 40 subjects (20 most coherent and 20 least coherent) Iranian undergraduates of English. This prompted us to identify the dominant types of cohesive devices used in most coherent writ...
متن کاملSimplifying and Improving Quali ed Types
Qualiied types provide a general framework for constrained type systems , with applications including type class overloading, subtyping and record calculi. This paper presents an extended version of the type inference algorithm used in previous work, that can take account of the satissability of constraints to obtain more accurate principal types. The new algorithm is obtained by adding two new...
متن کاملConstructions and Bounds for Visual Cryptography
A visual cryptography scheme for a set P of n participants is a method to encode a secret image SI into n images in such a way that any participant in P receives one image and only qualiied subsets of participants can \visually" recover the secret image, but non-qualiied sets of participants have no information, in an information theoretical sense, on SI. A \visual" recover for a set X P consis...
متن کامل