File:CritPair.pdf

Summary

Description
English: Shows a triangle diagram of a critical pair obtained from two rewrite rules st (upper row, left) and lr (right). The substitution σ unifies the subterm s|p with l. The resulting overlay term sσ[lσ]p (lower row, middle) can be rewritten to the term tσ and sσ[rσ]p (lower row, left and right), respectively. The latter two terms form the critical pair. They can be eventually rewritten to a common term, if the rewrite rule set is confluent.
Date
Source Own work
Author Jochen Burghardt
Other versions File:CritPair svg.svg
LaTeX source code
\documentclass[12pt]{article}
\usepackage[pdftex]{color}
\usepackage[paperwidth=455mm,paperheight=305mm]{geometry}
\usepackage{amssymb}
\usepackage{amsmath}
\setlength{\topmargin}{-36mm}
\setlength{\textwidth}{455mm}
\setlength{\textheight}{305mm}
\setlength{\oddsidemargin}{-2.5cm}
\setlength{\parindent}{0cm}
\setlength{\unitlength}{1mm}

% background colors
\definecolor{bL}        {rgb}{0.99,0.80,0.80}   % term l
\definecolor{bR}        {rgb}{0.80,0.99,0.80}   % term r
\definecolor{bS}        {rgb}{0.80,0.80,0.99}   % term s
\definecolor{bT}        {rgb}{0.99,0.99,0.80}   % term t
\definecolor{bSL}       {rgb}{0.80,0.60,0.80}   % s,l intersection
\definecolor{bSR}       {rgb}{0.60,0.80,0.80}   % s,r intersection
% foreground colors
\definecolor{fL}        {rgb}{0.50,0.00,0.00}   % term l
\definecolor{fR}        {rgb}{0.00,0.50,0.00}   % term r
\definecolor{fS}        {rgb}{0.00,0.00,0.50}   % term s
\definecolor{fT}        {rgb}{0.50,0.50,0.00}   % term t
\definecolor{fMeta}     {rgb}{0.00,0.00,0.00}   % diagram arrows etc.
\definecolor{fPath}     {rgb}{0.30,0.30,0.30}   % path p
\definecolor{fSbs}      {rgb}{0.10,0.10,0.10}   % substitution

\begin{document}
\begin{picture}(450,300)
        %\put(0,0){\makebox(0,0){$+$}}%
        %\put(450,300){\makebox(0,0){$+$}}%

\color{fMeta}
\thicklines
% rules
\put(135,230){\vector(-3,-1){60}}
\put(335,230){\vector(3,-1){60}}
%\put(105,225){\makebox(0,0)[r]{\bf Rule 1}}
%\put(365,225){\makebox(0,0)[l]{\bf Rule 2}}
% rewrites
\put(185,105){\vector(-3,-1){60}}
\put(285,105){\vector(3,-1){60}}
% local confluence?
\multiput(125,35)(30,-10){3}{\vector(3,-1){20}}
\multiput(345,35)(-30,-10){3}{\vector(-3,-1){20}}
\put(235,5){\makebox(0,0){\Huge\bf ?}} 

%%%%%%%%%%%%%%%%% rule: t %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\color{bT}
\multiput(5,190)(0.050,0.100){300}{\line(1,0){30}}
\multiput(35,250)(0.050,-0.100){480}{\line(-1,-2){15}}
\multiput(35,170)(0,0.050){400}{\line(1,0){30}}
\multiput(75,170)(-0.050,0.100){320}{\line(-1,0){30}}
\color{fT}
%\put(35,250){\circle*{1}}  % tip
\put(40,220){\makebox(0,0){\huge $t$}}
\put(5,190){\line(1,0){30}}
\put(35,170){\line(0,1){20}}
\put(35,170){\line(1,0){40}}
\put(5,190){\line(1,2){30}}
\put(35,250){\line(1,-2){40}}

%%%%%%%%%%%%%%%%% rule: s %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\color{bS}
\multiput(155,240)(0.050,0.100){300}{\line(1,0){30}}
\multiput(185,300)(0.050,-0.100){480}{\line(-1,-2){15}}
\multiput(185,220)(0,0.050){400}{\line(1,0){30}}
\multiput(225,220)(-0.050,0.100){320}{\line(-1,0){30}}
\color{fS}
%\put(185,300){\circle*{1}} % tip
\put(190,270){\makebox(0,0){\huge $s$}}
\put(155,240){\line(1,0){30}}
\put(185,220){\line(0,1){20}}
\put(185,220){\line(1,0){40}}
\put(155,240){\line(1,2){30}}
\put(185,300){\line(1,-2){40}}

%%%%%%%%%%%%%%%% rule: l %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\color{bL}
\multiput(265,240)(0.050,0.100){200}{\line(1,0){10}}
\multiput(280,270)(0.050,-0.100){200}{\line(-1,-2){5}}
\multiput(295,240)(-0.050,0.100){100}{\line(-1,0){20}}
\multiput(255,220)(0.050,0.100){200}{\line(1,0){20}}
\multiput(265,220)(0,0.100){200}{\line(1,0){20}}
\color{fL}
%\put(280,270){\circle*{1}} % tip
\put(280,250){\makebox(0,0){\huge $l$}}
\put(255,220){\line(1,0){29.500}}
\put(255,220){\line(1,2){25}}
\put(280,270){\line(1,-2){14.750}}
\put(284.500,220){\line(0,1){20.500}}
\put(284.500,240.500){\line(1,0){10.250}}

%%%%%%%%%%%%%%%% rule: r %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\color{bR}
\multiput(415,190)(0.050,0.100){200}{\line(1,0){10}}
\multiput(430,220)(0.050,-0.100){200}{\line(-1,-2){5}}
\multiput(445,190)(-0.050,0.100){100}{\line(-1,0){20}}
\multiput(405,170)(0.050,0.100){200}{\line(1,0){20}}
\multiput(415,170)(0,0.100){200}{\line(1,0){20}}
\color{fR}
%\put(430,220){\circle*{1}} % tip
\put(430,200){\makebox(0,0){\huge $r$}}
\put(405,170){\line(1,0){29.500}}
\put(405,170){\line(1,2){25}}
\put(430,220){\line(1,-2){14.750}}
\put(434.500,170){\line(0,1){20.500}}
\put(434.500,190.500){\line(1,0){10.250}}



%%%%%%%%%%%%%%%% rewrite result s->t %%%%%%%%%%%%%%%%%%%
\color{bT}
\multiput(55,65)(0.050,0.100){400}{\line(1,0){10}}
\multiput(85,125)(0.050,-0.100){480}{\line(-1,-2){10}}
\multiput(85,45)(0,0.050){400}{\line(1,0){30}}
\multiput(125,45)(-0.050,0.100){320}{\line(-1,0){20}}
\color{bT}
\multiput(65,65)(0.050,0.100){200}{\line(1,0){10}}
\multiput(80,95)(0.050,-0.100){200}{\line(-1,-2){5}}
\multiput(95,65)(-0.050,0.100){100}{\line(-1,0){20}}
\color{bL}
\multiput(55,45)(0.050,0.100){200}{\line(1,0){20}}
\multiput(65,45)(0,0.100){200}{\line(1,0){20}}
\color{fT}
%\put(85,125){\circle*{1}}  % tip
\put(90,95){\makebox(0,0){\huge $t$}}
\put(55,65){\line(1,0){30}}
\put(85,45){\line(0,1){20}}
\put(85,45){\line(1,0){40}}
\put(55,65){\line(1,2){30}}
\put(85,125){\line(1,-2){40}}
% matching subst
\color{fSbs}
\put(79.750,54.500){\makebox(0,0){\huge $\sigma$}}
\put(65.250,64.500){\line(-1,-2){9.500}}
\put(55.750,45.500){\line(1,0){29}}
%%%%%%%%%%%%%%%% redex overlap %%%%%%%%%%%%%%%%%%%%%%%%%
\color{bS}
\multiput(205,115)(0.050,0.100){400}{\line(1,0){10}}
\multiput(235,175)(0.050,-0.100){480}{\line(-1,-2){10}}
\multiput(235,95)(0,0.050){400}{\line(1,0){30}}
\multiput(275,95)(-0.050,0.100){320}{\line(-1,0){20}}
\color{bSL}
\multiput(215,115)(0.050,0.100){200}{\line(1,0){10}}
\multiput(230,145)(0.050,-0.100){200}{\line(-1,-2){5}}
\multiput(245,115)(-0.050,0.100){100}{\line(-1,0){20}}
\color{bL}
\multiput(205,95)(0.050,0.100){200}{\line(1,0){20}}
\multiput(215,95)(0,0.100){200}{\line(1,0){20}}
% s
\color{fS}
%\put(235,175){\circle*{1}} % tip
\put(240,145){\makebox(0,0){\huge $s$}}
\put(205,115){\line(1,0){30}}
\put(235,95){\line(0,1){20}}
\put(235,95){\line(1,0){40}}
\put(205,115){\line(1,2){30}}
\put(235,175){\line(1,-2){40}}
% l
\color{fL}
%\put(230,145){\circle*{1}} % tip
\put(230,125){\makebox(0,0){\huge $l$}}
\put(205,95){\line(1,0){29.500}}
\put(205,95){\line(1,2){25}}
\put(230,145){\line(1,-2){14.750}}
\put(234.500,95){\line(0,1){20.500}}
\put(234.500,115.500){\line(1,0){10.250}}
% matching subst
\color{fSbs}
\put(229.750,104.500){\makebox(0,0){\huge $\sigma$}}
\put(239.750,104.500){\makebox(0,0){\huge $\sigma$}}
\put(215.250,114.500){\line(1,0){30}}
\put(215.250,114.500){\line(-1,-2){9.500}}
\put(245.250,114.500){\line(1,-2){9.500}}
\put(205.750,95.500){\line(1,0){49}}
% path
\thinlines
\color{fPath}
\put(233,155){\makebox(0,0){\Large $p$}}
\put(235,175){\line(-1,-6){2}}
\put(233,163){\line(2,-5){4}}
\put(237,153){\line(-5,-3){5}}
\put(232,150){\line(-2,-5){2}}
\thicklines

%%%%%%%%%%%%%%%% rewrite result l->r %%%%%%%%%%%%%%%%%%%
\color{bS}
\multiput(355,65)(0.050,0.100){400}{\line(1,0){10}}
\multiput(385,125)(0.050,-0.100){480}{\line(-1,-2){10}}
\multiput(385,45)(0,0.050){400}{\line(1,0){30}}
\multiput(425,45)(-0.050,0.100){320}{\line(-1,0){20}}
\color{bSR}
\multiput(365,65)(0.050,0.100){200}{\line(1,0){10}}
\multiput(380,95)(0.050,-0.100){200}{\line(-1,-2){5}}
\multiput(395,65)(-0.050,0.100){100}{\line(-1,0){20}}
\color{bR}
\multiput(355,45)(0.050,0.100){200}{\line(1,0){20}}
\multiput(365,45)(0,0.100){200}{\line(1,0){20}}
% s
\color{fS}
%\put(385,125){\circle*{1}} % tip
\put(390,95){\makebox(0,0){\huge $s$}}
\put(355,65){\line(1,0){30}}
\put(385,45){\line(0,1){20}}
\put(385,45){\line(1,0){40}}
\put(355,65){\line(1,2){30}}
\put(385,125){\line(1,-2){40}}
% r
\color{fL}
%\put(380,95){\circle*{1}} % tip
\put(380,75){\makebox(0,0){\huge $r$}}
\put(355,45){\line(1,0){29.500}}
\put(355,45){\line(1,2){25}}
\put(380,95){\line(1,-2){14.750}}
\put(384.500,45){\line(0,1){20.500}}
\put(384.500,65.500){\line(1,0){10.250}}
% matching subst
\color{fSbs}
\put(390.500,54.500){\makebox(0,0){\huge $\sigma$}}
\put(385.250,64.500){\line(1,0){10}}
%\put(365.250,64.500){\line(-1,-2){9.500}}
\put(395.250,64.500){\line(1,-2){9.500}}
\put(385.250,45.500){\line(1,0){19.500}}

% path
\thinlines
\color{fPath}
\put(383,105){\makebox(0,0){\Large $p$}}
\put(385,125){\line(-1,-6){2}}
\put(383,113){\line(2,-5){4}}
\put(387,103){\line(-5,-3){5}}
\put(382,100){\line(-2,-5){2}}
\thicklines

\end{picture}
\end{document}

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Category:CC-BY-SA-3.0#CritPair.pdf
Category:Self-published work Category:Term rewriting systems Category:Images with LaTeX source code Category:Files by User:Jochen Burghardt
Category:CC-BY-SA-3.0 Category:Files by User:Jochen Burghardt Category:Images with LaTeX source code Category:Self-published work Category:Term rewriting systems