180 likes | 308 Views
Ordered sets and Lattices. CS 5303 – Logical Foundations of Computer Science. Orders and pre-orders . These relations are very important in Computer Science as they give a mean to compare objects
E N D
Ordered sets and Lattices CS 5303 – Logical Foundations of Computer Science
Orders and pre-orders • These relations are very important in Computer Science as they give a mean to compare objects • Definition: an order relation is a reflexive, antisymmetric and transitive relation. A strict order is an irreflexive and transitive relation • Example: >, <, , , order in a tree
Total order and partial order • Definition: if R is an order relation such that for a,a’ and aa’, then aRa’ or a’Ra, R is called a total order. • Example: and are total orders over ℕ or over the real numbers etc… Exercise: show that over the natural numbers, | (the division) is a partial order. Show that if E is a set, then is a partial order over P(E) (show that both orders are not total).
Pre-order • Definition: a pre-order relation is a transitive relation Exercise: Let E be a set and IdE the relation defined by (a,a’)IdE iff a=a’. Let R be q pre-order over E. Then show that IdE (R R-1) is an equivalence relation
Ordered sets • An ordered set (E,) is a set E endowed with an order . • Example: (ℕ,) is an ordered set and so is (ℕ,|).
Min and Max 1 • Definition: if E’ is a subset of and ordered set (E,), then an element of E is a majoring element of E’ if yx for all y in E’ • Minoring elements are defined similarly. • Maj(E’) and Min(E’) denotes the set of majoring and minoring elements. Exercise: show that Maj(E’)E’ and Min(E’)E’ have at most one element
Min and Max 2 • Definition: if Maj(E’)E’ and Min(E’)E’ are non empty then their elements are called the maximum of E’ and minimum of E’ respectively. • Definition: an element x is the least greatest bound (sup) of E’ in E if for any y in E’ yx and if z in E is such that for any y in e’ yz then xz. The inf is defined similarly.
Lattices • Definition: if (E,) is an ordered set, then it is a lattice if every pair of elements x,y admits an sup and an inf. • Notations: sup(x,y) is sometimes written x∨y and inf(x,y) is written x∧y Exercise: show that (P(E),) is a lattice.
Properties • The inf and sup are 1. idempotent 2. commutative 3. associate 4. absorbing x∧(x∨y)=x = (y∧x)∨x • If inf and sup are distributive wrt one another, the lattice is called a distributive lattice
Exercise: distributive lattice? ⊤ c a b ⊥
Complemented lattice • Definition: a lattice is complemented iff • There is a minimum ⊥ and a maximum ⊤ that are distinct. • There exists an application :EE such that for all x in E, - x∧(x)= ⊥ - x∨(x)= ⊤ Exercise: Show that (P(E), ) is a complemented lattice
Complete lattices • Definition: a lattice is called a complete lattice if every subset A of A admits a sup and an inf. Exercise: show that (P(E),) is a complete lattice.
Application: formal concept analysis • FCA is a model to formalize the notions of concepts and conceptual hierarchies • Critical for conceptual data analysis and knowledge processing • Successfully used in decision engines, classification engines (e-mail), but also formal methods and patterns in software engineering, analysis of flight movements (Frankfurt), analysis of diabetic children (mcgill U.)
Basics of FCA • Definition: a formal context K=(G,M,I) consists of a set G of objects, a set M of attributes and a binary relation I over GxM where gIm (or (g,m)I) reads object g has property m • I is called the incidence relation • Small contexts can be represented by cross tables
Formal concepts • Definition: a formal concept of the context (G,M,I) is a pair (A,B) with AG, BM and A’=B, B’=A with • A’={m in M| gIm for all g in A} • B’={g in G | gIm for all m in B} • If (A1,B1) and (A2,B2) are concepts then A1 A2 defines an order on the concepts making B(G,M,I) the concept lattice
Example (R. Godin – UQAM) Ref:http://www.info.uqam.ca/~godin/ Formal concept analysis based normal forms for class hierarchy design in object-oriented Software development
Example 2 (Godin) • Designing and maintaining good class hierarchy large solution space, conflicting criteria, evolution • FCA minimize redundancy, number of classes, multiple inheritance only if necessary, subclasses as specialization
Example 3 (Godin) • G classes, objects • M instance variables, methods • I comes from analyst, code, patterns