notas-lc/progra_log.tex
2024-04-02 11:05:31 -06:00

65 lines
3 KiB
TeX
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{multicol}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{caption}
\renewcommand{\rmdefault}{ptm}
\usepackage{pgf}
\usepackage{tikz}
\usetikzlibrary{automata,positioning,arrows}
%\tikzset{->, % makes the edges directed
% >=stealth, % makes the arrow heads bold
% node distance=3cm, % specifies the minimum distance between two nodes. Change if necessary.
% every state/.style={thick, fill=gray!10}, % sets the properties for each state node
% initial text=$ $ % sets the text that appears on the start arrow
% }
%\usetikzlibrary{arrows,automata}
%\usepackage[all,cmtip]{xy}
%\usepackage{graphicx}
\author{Lógica computacional}
\title{Programación lógica y bases de datos}
\begin{document}
\maketitle
\section{Unificadores}
En la sección pasada hablamos de sustituciones y sus composiciones. Los unificadores son un tipo específico de sustituciones que hacen que dos términos sean idénticos. Si tenemos $f(a,y,z)$ y $f(x,b,z)$ la sustitución $\{x/a, y/b\}$ es un unificador de ambos términos. No es el único, podría también usarse $\{x/a, y/b, z/a\}$ pero es menos general.
\newtheorem{defi}{Definición}
\begin{defi}
Sean $\theta$ y $\tau$ sustituciones. Decimos que $\theta$ es \emph{más general que} $\tau$ si para alguna sustitución $\eta$ tenemos $\tau = \theta \eta$.
\end{defi}
\textbf{Ejemplo:} La sustitución $\{x/y\}$ es más general que $\{x/a, y/a\}$, ya que $\{x/y\}\{y/a\} = \{x/y\}.$
\textbf{Contraejemplo:} $\{x/y\}$ no es más general que $\{x/a\}$.
\newtheorem{lema}{Lema}
\begin{lema}
$\theta$ es más general que $\eta$ y $\eta$ es más general que $\theta$ si y sólo si por algún renombramiento $\gamma$ tal que $Var(\gamma)\subseteq Var(\theta) \cup Var (\eta)$, tenemos $\eta = \theta \gamma$
\end{lema}
\begin{defi}
\begin{enumerate}
\item $\theta$ es llamado un \emph{unificador} se $s$ y $t$ si $s\theta = t\theta$. Si un unificador de $s$ y $t$ existe, decimos que $s$ y $t$ son unificables.
\item $\theta$ es llamado un \emph{unificador más general} (mgu, por sus siglas en inglés)de $s$ y $t$ si es un unificador de ambos y es más general que cualquier otro unificador de $s$ y $t$.
\item Un mgu $\theta$ se $s$ y $t$ se llama fuerte si para todos los unificadores $\eta$ de $s$ y $t$ tenemos $\eta = \theta \eta$
\end{enumerate}
\end{defi}
\textbf{Ejemplo:} Tenemos los términos $f(g(x,a), z)$ y $f(y,b)$. Entonces $\{x/c, y/g(c,a), z/b\}$ es uno de sus unificadores, al igual que $\{y/g(x,a),z/b\}$ que es más general que el primero, ya que $\{x/c, y/g(c,a), z/b\} = \{y/g(x,a),z/b\}\{x/c\}$.
De hecho es el más general y es fuerte ya que:
\begin{equation*}
\{x/c, y/g(c,a), z/b\} = \{y/g(x,a),z/b\}\{x/c, y/g(c,a), z/b\}
\end{equation*}
\textbf{Contraejemplo:} Considera los términos $f(g(x,a),z)$ y $f(g(x,b),b)$. No son unificables.
\end{document}