Inference with Rewriting Rules (1)

Total Page:16

File Type:pdf, Size:1020Kb

Inference with Rewriting Rules (1) . Inference with Rewriting Rules (1) . .. NAKAMURA Masaki . Toyama Pref. Univ. December 17, 2013 NAKAMURA Masaki (Toyama Pref. Univ.) Inference with Rewriting Rules (1) December 17, 2013 1 / 22 . Content 1 Term rewriting systems .. 2 Termination Semantic methods Syntactic methods Incremental proofs of termination .. NAKAMURA Masaki (Toyama Pref. Univ.) Inference with Rewriting Rules (1) December 17, 2013 2 / 22 . Equational reasoning by rewriting The CafeOBJ reduction command implements equational logic by rewriting and can be used as a powerful interactive theorem proving system { { X + 0 = X (1) X + 0 ! X (1) E = R = X + s(Y ) = s(X + Y ) (2) X + s(Y ) ! s(X + Y ) (2) Bidirectional equations are not suitable Equations are regarded as left-to-right for automated equational reasoning rewrite rules s(0) + s(s(0)) =2+ s(s(0) + s(0)) s(0) + s(s(0)) =?E s(s(0)) + s(0) # # =2+ s(s(s(0) + 0)) 2 2 =1+ s(s(s(0))) s(s(0) + s(0)) s(s(s(0)) + 0) # # =1− s(s(s(0)) + 0) 2 1 ! =2− s(s(0)) + s(0) s(s(s(0) + 0)) 1 s(s(s(0))) NAKAMURA Masaki (Toyama Pref. Univ.) Inference with Rewriting Rules (1) December 17, 2013 3 / 22 . How to describe equational specifications Not all equational specifications can work well as rewriting systems R0 = fa ! b; b ! ag may result in an infinite loop ! ! ! ··· a R0 b R0 a R0 R1 = fa ! b; a ! cg cannot prove b = c by rewriting ! 6! 6! b R1 a R1 c; but c R1 a; b R1 a Unfortunately, CafeOBJ system does not find suitable rewrite rules (directions) from input equational specifications. We need a way to describe equational specifications as rewrite systems. NAKAMURA Masaki (Toyama Pref. Univ.) Inference with Rewriting Rules (1) December 17, 2013 4 / 22 . Terms To concentrate to understand a mechanism of rewriting, we first assume simple equational specifications which has only one sort, operators without any attributes (assoc, comm, etc) and unconditional equations Σ : the set of operators f ; g; h;::: 2 Σ TΣ(X ) (abbr. T ): the set of terms constructed from operators in Σ and variables in the variable set X X ; Y ; Z;::: 2 X f (0); g(c; X ); h(f (0); g(c; X ); Y );::: 2 TΣ(X ) NAKAMURA Masaki (Toyama Pref. Univ.) Inference with Rewriting Rules (1) December 17, 2013 5 / 22 . Term rewriting systems A (Σ-)rewrite rule is defined as a pair (l; r) 2 TΣ(X ) × TΣ(X ) of terms, denoted by l ! r, which satisfies the following variable conditions l 62 X , that is, the left-hand side of any rewrite rule is not a variable X + 0 ! X : OK X ! X + 0 : NG V (r) ⊆ V (l), that is, all variables appearing in r should appear in l X + s(Y ) ! s(X + Y ): OK 0 ! X ∗ 0 : NG A pair (Σ; R) of a set Σ of operators and a set R of Σ-rewrite rules is called a term rewriting system (TRS). When we call R a TRS, its Σ is the set of all operators appearing in R. The CafeOBJ reduction command ignores equations which do not satisfy the first variable conditions, e.g. X ! X + 0. NAKAMURA Masaki (Toyama Pref. Univ.) Inference with Rewriting Rules (1) December 17, 2013 6 / 22 . Subterms The set O(t) of positions of a term t is defined as O(x) = f"g and f g [ f 2 N ∗ j 2 f g 2 g O(f (¯tn)) = " i:p + i n¯ ; p O(ti ) Ex: Let t = x + s(y). O(t) = f"; 1; 2; 2:1g where " is the empty string, and ¯tn is abbr. of t1;::: tn. The subterm of a term t at position p 2 O(t), denoted by tjp, is defined as tj" = t and f (¯tn)ji:p = ti jp Ex: tj" = x + s(y); tj1 = x; tj2 = s(y); tj2:1 = y 0 The subterm relation ≥sub is defined as follows: t ≥sub t if and only 0 if t = tjp for some p 2 O(t), and the strict subterm relation >sub is defined as ≥sub n =. Ex: x + s(y) >sub s(y) >sub y NAKAMURA Masaki (Toyama Pref. Univ.) Inference with Rewriting Rules (1) December 17, 2013 7 / 22 . Substitution 0 0 The replacement of t with t at position p 2 O(t), denoted by t[t ]p, 0 0 0 0 is defined as t[t ]" = t and f (¯tn)[t ]i:p = f (:::; ti [t ]p;:::) Ex. Let t = x + s(y). t[0 + 0]1 = (0 + 0) + s(y) and t[0 + 0]2:1 = x + s(0 + 0) A map θ 2 T X from the set of variables X to a set of terms T is called a substitution if Dom(θ) = fx 2 X j θ(x) =6 xg is finite. We write θ = fx0 t0; x1 t1;:::; xn tng when θ(xi ) = ti for all i 2 Dom(θ) The instance of a term t by θ, denoted by tθ, is defined as xθ = θ(x) and f (¯tn)θ = f (tnθ). tθ0 = s(0) + s(0) if θ0 = fx s(0); y 0g tθ1 = s(y) + s(x + z) if θ1 = fx s(y); y x + zg NAKAMURA Masaki (Toyama Pref. Univ.) Inference with Rewriting Rules (1) December 17, 2013 8 / 22 . Rewrite relation For a TRS R, the rewrite relation !R is defined as follows: 0 X 0 t !l!r t () 9θ 2 T :9p 2 O(t): tjp = lθ ^ t = t[rθ]p 0 0 t !R t () 9l ! r 2 R:t !l!r t Ex. Let R+ = f(1) : X + 0 ! X ; (2) : X + s(Y ) ! s(X + Y )g s(s(0)) + s(0) !(2) s(s(s(0)) + 0) !(1) s(s(s(0))) !+ ! R is the transitive closure of R (more than zero steps) !∗ ! R is the reflexive and transitive closure of R (zero or more than zero steps). !∗ s(s(0)) + s(0) R+ s(s(s(0))) An instance of l of some l ! r 2 R is called a redex A term t is called an (R-)normal form if there is no u such that t !R u. NAKAMURA Masaki (Toyama Pref. Univ.) Inference with Rewriting Rules (1) December 17, 2013 9 / 22 . Equational reasoning ∗ A congruence relation =R is defined as (!R [ R ) 0 When we regard R as a set of equations, t =R t means the equation can be deduced from the axioms R. One of the purposes of the TRS 0 is to prove t =R t by rewriting. # 0 !∗ 0 !∗ t R t if and only if there exists u such that t R u and t R u. We call t and t0 joinalble. 0 0 It is trivial that t =R t ( t #R t 0 0 The converse t =R t ) t #R t is not always true as I showed Termination and confluence properties give us a sufficient condition 0 0 under which t =R t , t #R t NAKAMURA Masaki (Toyama Pref. Univ.) Inference with Rewriting Rules (1) December 17, 2013 10 / 22 . Termination and confluece R is terminating if there is no infinite rewrite sequence t0 !R t1 !R ··· . # 0 9 !∗ ^ !∗ 0 R is confluent if t R t whenever u. u R t u R t Termination guarantees the existence of a normal form of an input term and it can be computable in finite time, and confluence guarantees the uniqueness of normal forms. If a term t is reduced into normal forms t1 and t2, then there exists u !∗ ∗ s.t. t1 R u R t2. Since they are normal forms, we have t1 = t2. [Proposition] Let R be a terminating and confluent TRS. Then, 0 0 t =R t , t #R t NAKAMURA Masaki (Toyama Pref. Univ.) Inference with Rewriting Rules (1) December 17, 2013 11 / 22 . Proving termination Termination is undecidable, that is, there is no algorithm to solve the problem: whether R is terminating or not. There are several useful methods and tools to prove termination A basic idea is to find a well-founded ordering > on terms satisfying 0 0 t !R t implies t > t . > is well-founded if there is no infinite decreasing sequence a0 > a1 > ··· , e.g. the strict ordering on natural numbers 0 0 It is not easy to prove t > t for all t !R t since !R may be infinite (even if R is finite) For R0 = ff (X ; Y ) ! X g, ! ! we have f (a; b) R0 a and f (f (a; b); c) R0 f (a; c), and so on NAKAMURA Masaki (Toyama Pref. Univ.) Inference with Rewriting Rules (1) December 17, 2013 12 / 22 . Reduction ordering An irreflexive (t >6 t) and transitive relation is called a strict ordering A relation >⊆ T × T is stable if for all substitution θ and terms t; t0, t > t0 implies tθ > t0θ Let Σ the set of all operators. A relation >⊆ T × T is monotonic if for all f 2 Σ, ¯sn; ti 2 T , si > ti implies f (:::; si−1; si ; si+1;:::) > f (:::; si−1; ti ; si+1;:::) A rewrite ordering is a stable and monotic strict ordering A reduction ordering is a well-founded rewrite ordering [Proposition] R is terminating if and only if there exists a reduction ordering > s.t. l > r for all l ! r 2 R Two kinds of methods to obtain a reduction ordering have been considered: semantic methods and syntactic methods NAKAMURA Masaki (Toyama Pref.
Recommended publications
  • Relations-Handoutnonotes.Pdf
    Introduction Relations Recall that a relation between elements of two sets is a subset of their Cartesian product (of ordered pairs). Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Definition A binary relation from a set A to a set B is a subset R ⊆ A × B = {(a, b) | a ∈ A, b ∈ B} Spring 2006 Note the difference between a relation and a function: in a relation, each a ∈ A can map to multiple elements in B. Thus, Computer Science & Engineering 235 relations are generalizations of functions. Introduction to Discrete Mathematics Sections 7.1, 7.3–7.5 of Rosen If an ordered pair (a, b) ∈ R then we say that a is related to b. We [email protected] may also use the notation aRb and aRb6 . Relations Relations Graphical View To represent a relation, you can enumerate every element in R. A B Example a1 b1 a Let A = {a1, a2, a3, a4, a5} and B = {b1, b2, b3} let R be a 2 relation from A to B as follows: a3 b2 R = {(a1, b1), (a1, b2), (a1, b3), (a2, b1), a4 (a3, b1), (a3, b2), (a3, b3), (a5, b1)} b3 a5 You can also represent this relation graphically. Figure: Graphical Representation of a Relation Relations Reflexivity On a Set Definition Definition A relation on the set A is a relation from A to A. I.e. a subset of A × A. There are several properties of relations that we will look at. If the ordered pairs (a, a) appear in a relation on a set A for every a ∈ A Example then it is called reflexive.
    [Show full text]
  • On the Satisfiability Problem for Fragments of the Two-Variable Logic
    ON THE SATISFIABILITY PROBLEM FOR FRAGMENTS OF TWO-VARIABLE LOGIC WITH ONE TRANSITIVE RELATION WIESLAW SZWAST∗ AND LIDIA TENDERA Abstract. We study the satisfiability problem for two-variable first- order logic over structures with one transitive relation. We show that the problem is decidable in 2-NExpTime for the fragment consisting of formulas where existential quantifiers are guarded by transitive atoms. As this fragment enjoys neither the finite model property nor the tree model property, to show decidability we introduce a novel model con- struction technique based on the infinite Ramsey theorem. We also point out why the technique is not sufficient to obtain decid- ability for the full two-variable logic with one transitive relation, hence contrary to our previous claim, [FO2 with one transitive relation is de- cidable, STACS 2013: 317-328], the status of the latter problem remains open. 1. Introduction The two-variable fragment of first-order logic, FO2, is the restriction of classical first-order logic over relational signatures to formulas with at most two variables. It is well-known that FO2 enjoys the finite model prop- erty [23], and its satisfiability (hence also finite satisfiability) problem is NExpTime-complete [7]. One drawback of FO2 is that it can neither express transitivity of a bi- nary relation nor say that a binary relation is a partial (or linear) order, or an equivalence relation. These natural properties are important for prac- arXiv:1804.09447v3 [cs.LO] 9 Apr 2019 tical applications, thus attempts have been made to investigate FO2 over restricted classes of structures in which some distinguished binary symbols are required to be interpreted as transitive relations, orders, equivalences, etc.
    [Show full text]
  • Math 475 Homework #3 March 1, 2010 Section 4.6
    Student: Yu Cheng (Jade) Math 475 Homework #3 March 1, 2010 Section 4.6 Exercise 36-a Let ͒ be a set of ͢ elements. How many different relations on ͒ are there? Answer: On set ͒ with ͢ elements, we have the following facts. ) Number of two different element pairs ƳͦƷ Number of relations on two different elements ) ʚ͕, ͖ʛ ∈ ͌, ʚ͖, ͕ʛ ∈ ͌ 2 Ɛ ƳͦƷ Number of relations including the reflexive ones ) ʚ͕, ͕ʛ ∈ ͌ 2 Ɛ ƳͦƷ ƍ ͢ ġ Number of ways to select these relations to form a relation on ͒ 2ͦƐƳvƷͮ) ͦƐ)! ġ ͮ) ʚ ʛ v 2ͦƐƳvƷͮ) Ɣ 2ʚ)ͯͦʛ!Ɛͦ Ɣ 2) )ͯͥ ͮ) Ɣ 2) . b. How many of these relations are reflexive? Answer: We still have ) number of relations on element pairs to choose from, but we have to 2 Ɛ ƳͦƷ ƍ ͢ include the reflexive one, ʚ͕, ͕ʛ ∈ ͌. There are ͢ relations of this kind. Therefore there are ͦƐ)! ġ ġ ʚ ʛ 2ƳͦƐƳvƷͮ)Ʒͯ) Ɣ 2ͦƐƳvƷ Ɣ 2ʚ)ͯͦʛ!Ɛͦ Ɣ 2) )ͯͥ . c. How many of these relations are symmetric? Answer: To select only the symmetric relations on set ͒ with ͢ elements, we have the following facts. ) Number of symmetric relation pairs between two elements ƳͦƷ Number of relations including the reflexive ones ) ʚ͕, ͕ʛ ∈ ͌ ƳͦƷ ƍ ͢ ġ Number of ways to select these relations to form a relation on ͒ 2ƳvƷͮ) )! )ʚ)ͯͥʛ )ʚ)ͮͥʛ ġ ͮ) ͮ) 2ƳvƷͮ) Ɣ 2ʚ)ͯͦʛ!Ɛͦ Ɣ 2 ͦ Ɣ 2 ͦ . d.
    [Show full text]
  • PROBLEM SET THREE: RELATIONS and FUNCTIONS Problem 1
    PROBLEM SET THREE: RELATIONS AND FUNCTIONS Problem 1 a. Prove that the composition of two bijections is a bijection. b. Prove that the inverse of a bijection is a bijection. c. Let U be a set and R the binary relation on ℘(U) such that, for any two subsets of U, A and B, ARB iff there is a bijection from A to B. Prove that R is an equivalence relation. Problem 2 Let A be a fixed set. In this question “relation” means “binary relation on A.” Prove that: a. The intersection of two transitive relations is a transitive relation. b. The intersection of two symmetric relations is a symmetric relation, c. The intersection of two reflexive relations is a reflexive relation. d. The intersection of two equivalence relations is an equivalence relation. Problem 3 Background. For any binary relation R on a set A, the symmetric interior of R, written Sym(R), is defined to be the relation R ∩ R−1. For example, if R is the relation that holds between a pair of people when the first respects the other, then Sym(R) is the relation of mutual respect. Another example: if R is the entailment relation on propositions (the meanings expressed by utterances of declarative sentences), then the symmetric interior is truth- conditional equivalence. Prove that the symmetric interior of a preorder is an equivalence relation. Problem 4 Background. If v is a preorder, then Sym(v) is called the equivalence rela- tion induced by v and written ≡v, or just ≡ if it’s clear from the context which preorder is under discussion.
    [Show full text]
  • Relations April 4
    math 55 - Relations April 4 Relations Let A and B be two sets. A (binary) relation on A and B is a subset R ⊂ A × B. We often write aRb to mean (a; b) 2 R. The following are properties of relations on a set S (where above A = S and B = S are taken to be the same set S): 1. Reflexive: (a; a) 2 R for all a 2 S. 2. Symmetric: (a; b) 2 R () (b; a) 2 R for all a; b 2 S. 3. Antisymmetric: (a; b) 2 R and (b; a) 2 R =) a = b. 4. Transitive: (a; b) 2 R and (b; c) 2 R =) (a; c) 2 R for all a; b; c 2 S. Exercises For each of the following relations, which of the above properties do they have? 1. Let R be the relation on Z+ defined by R = f(a; b) j a divides bg. Reflexive, antisymmetric, and transitive 2. Let R be the relation on Z defined by R = f(a; b) j a ≡ b (mod 33)g. Reflexive, symmetric, and transitive 3. Let R be the relation on R defined by R = f(a; b) j a < bg. Symmetric and transitive 4. Let S be the set of all convergent sequences of rational numbers. Let R be the relation on S defined by f(a; b) j lim a = lim bg. Reflexive, symmetric, transitive 5. Let P be the set of all propositional statements. Let R be the relation on P defined by R = f(a; b) j a ! b is trueg.
    [Show full text]
  • Relations II
    CS 441 Discrete Mathematics for CS Lecture 22 Relations II Milos Hauskrecht [email protected] 5329 Sennott Square CS 441 Discrete mathematics for CS M. Hauskrecht Cartesian product (review) •Let A={a1, a2, ..ak} and B={b1,b2,..bm}. • The Cartesian product A x B is defined by a set of pairs {(a1 b1), (a1, b2), … (a1, bm), …, (ak,bm)}. Example: Let A={a,b,c} and B={1 2 3}. What is AxB? AxB = {(a,1),(a,2),(a,3),(b,1),(b,2),(b,3)} CS 441 Discrete mathematics for CS M. Hauskrecht 1 Binary relation Definition: Let A and B be sets. A binary relation from A to B is a subset of a Cartesian product A x B. Example: Let A={a,b,c} and B={1,2,3}. • R={(a,1),(b,2),(c,2)} is an example of a relation from A to B. CS 441 Discrete mathematics for CS M. Hauskrecht Representing binary relations • We can graphically represent a binary relation R as follows: •if a R b then draw an arrow from a to b. a b Example: • Let A = {0, 1, 2}, B = {u,v} and R = { (0,u), (0,v), (1,v), (2,u) } •Note: R A x B. • Graph: 2 0 u v 1 CS 441 Discrete mathematics for CS M. Hauskrecht 2 Representing binary relations • We can represent a binary relation R by a table showing (marking) the ordered pairs of R. Example: • Let A = {0, 1, 2}, B = {u,v} and R = { (0,u), (0,v), (1,v), (2,u) } • Table: R | u v or R | u v 0 | x x 0 | 1 1 1 | x 1 | 0 1 2 | x 2 | 1 0 CS 441 Discrete mathematics for CS M.
    [Show full text]
  • CDM Relations
    CDM 1 Relations Relations Operations and Properties Orders Klaus Sutner Carnegie Mellon University Equivalence Relations 30-relations 2017/12/15 23:22 Closures Relations 3 Binary Relations 4 We have seen how to express general concepts (or properties) as sets: we form the set of all objects that “fall under” the concept (in Frege’s Let’s focus on the binary case where two objects are associated, though terminology). Thus we can form the set of natural numbers, of primes, of not necessarily from the same domain. reals, of continuous functions, of stacks, of syntactically correct The unifying characteristic is that we have some property (attribute, C-programs and so on. quality) that can hold or fail to hold of any two objects from the Another fundamental idea is to consider relationships between two or appropriate domains. more objects. Here are some typical examples: Standard notation: for a relation P and suitable objects a and b write P (a, b) for the assertion that P holds on a and b. divisibility relation on natural numbers, Thus we can associate a truth value with P (a, b): the assertion holds if a less-than relation on integers, and b are indeed related by P , and is false otherwise. greater-than relation on rational numbers, For example, if P denotes the divisibility relation on the integers then the “attends course” relation for students and courses, P (3, 9) holds whereas P (3, 10) is false. the “is prerequisite” relation for courses, Later we will be mostly interested in relations where we can effectively the “is a parent of” relation for humans, determine whether P (a, b) holds, but for the time being we will consider the “terminates on input and produces output” relation for programs the general case.
    [Show full text]
  • Rewriting Abstract Reduction Relations
    A Change in Notation From now on, when we write Γ j= ', 22c:295 Seminar in AI — Decision Procedures we will assume that all the free variables of ' and of each formula in Γ are universally quantified. Rewriting This is done for convenience, but note that it does change the Cesare Tinelli meaning of j= for non-closed formulas. [email protected] Example The University of Iowa Without implicit quantifiers: p(x) 6j= p(y). With the implicit quantifiers: p(x) j= p(y). Copyright 2004-05 — Cesare Tinelli and Clark Barrett. a a These notes were developed from a set of lecture notes originally written by Clark Barrett at New York University. These notes are copyrighted material and may not be used in other course settings outside of the University of Iowa in their current form or modified form without the express written permission of the copyright holders. Spring 04, 22c:295 Notes: Rewriting – p.1/25 Spring 04, 22c:295 Notes: Rewriting – p.3/25 Outline Rewriting • Rewriting Consider the general problem of establishing E j= s = t where E • Termination is a set of equations. • Completion Congruence closure handles the case when all equations are ground. (How?) Sources: There cannot be a simple procedure for the more general case Harrison, John. Introduction to Logic and Automated because first order logic with equality is, in general, undecidable. Theorem Proving. Unpublished manuscript. Used by permission. However, often the kind of equational reasoning needed is straightforward: equations are used in a predictable direction to simplify expressions. Using equations in a directional fashion is called rewriting, and there are indeed cases when this technique gives us a decision procedure.
    [Show full text]
  • Functions, Relations, Partial Order Relations Definition: the Cartesian Product of Two Sets a and B (Also Called the Product
    Functions, Relations, Partial Order Relations Definition: The Cartesian product of two sets A and B (also called the product set, set direct product, or cross product) is defined to be the set of all pairs (a,b) where a ∈ A and b ∈ B . It is denoted A X B. Example : A ={1, 2), B= { a, b} A X B = { (1, a), (1, b), (2, a), (2, b)} Solve the following: X = {a, c} and Y = {a, b, e, f}. Write down the elements of: (a) X × Y (b) Y × X (c) X 2 (= X × X) (d) What could you say about two sets A and B if A × B = B × A? Definition: A function is a subset of the Cartesian product.A relation is any subset of a Cartesian product. For instance, a subset of , called a "binary relation from to ," is a collection of ordered pairs with first components from and second components from , and, in particular, a subset of is called a "relation on ." For a binary relation , one often writes to mean that is in . If (a, b) ∈ R × R , we write x R y and say that x is in relation with y. Exercise 2: A chess board’s 8 rows are labeled 1 to 8, and its 8 columns a to h. Each square of the board is described by the ordered pair (column letter, row number). (a) A knight is positioned at (d, 3). Write down its possible positions after a single move of the knight. Answer: (b) If R = {1, 2, ..., 8}, C = {a, b, ..., h}, and P = {coordinates of all squares on the chess board}, use set notation to express P in terms of R and C.
    [Show full text]
  • Varieties of Parthood
    Varieties of Parthood Paul Hovda May 30, 2017 1 Introduction The basic intuitive idea driving the work in this paper is that there are multiple relations that are like the relation of part-to-whole, and various general principles that govern and organize these relations. A variation of this idea is that there are multiple ways of being a part; another is that there are multiple relations that are equally good candidates for being called \the" part-whole relation. To illustrate one version of this idea, we might think that there are distinct primitive manners of being a part: for example, Socrates' nose is a part of Socrates in one manner (call it R), and Socrates is a part of the set Socrates in a different manner (call it S). And it seems plausible that Socrates'f noseg is not a part of the set in any primitive manner. But it is a part in some derivative manner. We might say that there is a derivative form of parthood that is the \union" of R and S, call it R S. Now the nose does not bear even this relation to the set. But it does[ bear the ancestral of this relation to the set. So we have a fourth, more inclusive or \tolerant" form of being a part. There is a much more detailed discussion of informal versions of the ideas pursued here in [Hovda, 2016]. The basic outlook is deeply indebted to Kit Fine's [Fine, 2010], though there are some differences of approach. A key difference throughout is that we do not assume that all forms of parthood are anti-symmetric.
    [Show full text]
  • Introduction to Relations Binary Relation
    Introduction to Relations CSE 191, Class Note 09 Computer Sci & Eng Dept SUNY Buffalo c Xin He (University at Buffalo) CSE 191 Descrete Structures 1 / 57 Binary relation Definition: Let A and B be two sets. A binary relation from A to B is a subset of A B. × In other words, a binary relation from A to B is a set of pair (a, b) such that a A and b B. ∈ ∈ We often omit “binary” if there is no confusion. If R is a relation from A to B and (a, b) R, we say a is related to b by R. ∈ We write a R b. Example: Let A be the set of UB students, and B be the set of UB courses. Define relation R from A to B as follows: a R b if and only if student a takes course b. So for every student x in this classroom, we have that (x, CSE191) R, or ∈ equivalently, x R CSE191. For your TA Ding , we know that Ding is NOT related to CSE191 by R. c XinSo He (University(Ding, CSE at Buffalo)191) R. CSE 191 Descrete Structures 3 / 57 6∈ Relation on a set We are particularly interested in binary relations from a set to the same set. If R is a relation from A to A, then we say R is a relation on set A. Example: We can define a relation R on the set of positive integers such that a R b if and only if a b. | 3 R 6.
    [Show full text]
  • Arxiv:1111.1390V1
    On extension of partial orders to total preorders with prescribed symmetric part1 Dmitry V. Akopian and Valentin V. Gorokhovik Institute of Mathematics, The National Academy of Sciences of Belarus, Surganova st., 11, Minsk 220072, Belarus e-mail: [email protected] Abstract For a partial order on a set X and an equivalency relation S defined on the same set X we derive a necessary and sufficient condition for the existence of such a total preorder on X whose asymmetric part contains the asymmetric part of the given partial order and whose symmetric part coincides with the given equivalence relation S. This result generalizes the classical Szpilrajn theorem on extension of a partial order to a perfect (linear) order. Key words partial order, preorder, extension, Szpilrajn theorem, Dushnik-Miller theorem. MSC 2010 Primary: 06A06 Secondary: 06A05, 91B08 Let X be an arbitrary nonempty set and let G ⊂ X × X be a binary relation on X. A binary relation G ⊂ X × X is called a preorder if it is reflexive ( (x, x) ∈ G ∀ x ∈ X ) and transitive ( (x, y) ∈ G, (y, z) ∈ G ⇒ (x, z) ∈ G ∀ x,y,z ∈ X ). If in addition a preorder G ∈ X × X is antisymmetric ( (x, y) ∈ G, (y, x) ∈ G ⇒ x = y ∀ x,y ∈ X ), then it is called a partial order. A total partial order is called a perfect (or linear) order. (A binary relation G ⊂ X × X is total if for any x, y ∈ X either (x, y) ∈ G or (y, x) ∈ G holds.) In the sequel, a preorder will be preferably denoted by the symbol - whereas a partial order as well as a perfect order by the symbol .
    [Show full text]