programacion log

This commit is contained in:
Vladimir Lemus 2024-04-02 11:05:31 -06:00
parent 691d7e4b9e
commit bcee56e60b
3 changed files with 99 additions and 0 deletions

BIN
progra_log.pdf Normal file

Binary file not shown.

64
progra_log.tex Normal file
View File

@ -0,0 +1,64 @@
\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}

35
progra_log.tex~ Normal file
View File

@ -0,0 +1,35 @@
\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{Fundamentos teóricos}
\end{document}