diff options
| author | Juan Marín Noguera <juan.marinn@um.es> | 2020-02-20 13:15:34 +0100 |
|---|---|---|
| committer | Juan Marín Noguera <juan.marinn@um.es> | 2020-02-20 13:15:34 +0100 |
| commit | 29eb708670963c0ca5bd315c83a3cec8dafef1a7 (patch) | |
| tree | 1a53fce36c4ef876bd73b98fff88e79cc4377803 /ip/n1.lyx | |
Commit inicial, primer cuatrimestre.
Diffstat (limited to 'ip/n1.lyx')
| -rw-r--r-- | ip/n1.lyx | 1788 |
1 files changed, 1788 insertions, 0 deletions
diff --git a/ip/n1.lyx b/ip/n1.lyx new file mode 100644 index 0000000..1936a5c --- /dev/null +++ b/ip/n1.lyx @@ -0,0 +1,1788 @@ +#LyX 2.3 created this file. For more info see http://www.lyx.org/ +\lyxformat 544 +\begin_document +\begin_header +\save_transient_properties true +\origin unavailable +\textclass book +\use_default_options true +\maintain_unincluded_children false +\language spanish +\language_package default +\inputencoding auto +\fontencoding global +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_osf false +\font_sf_scale 100 100 +\font_tt_scale 100 100 +\use_microtype false +\use_dash_ligatures true +\graphics default +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\paperfontsize default +\spacing single +\use_hyperref false +\papersize default +\use_geometry false +\use_package amsmath 1 +\use_package amssymb 1 +\use_package cancel 1 +\use_package esint 1 +\use_package mathdots 1 +\use_package mathtools 1 +\use_package mhchem 1 +\use_package stackrel 1 +\use_package stmaryrd 1 +\use_package undertilde 1 +\cite_engine basic +\cite_engine_type default +\biblio_style plain +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\justification true +\use_refstyle 1 +\use_minted 0 +\index Index +\shortcut idx +\color #008000 +\end_index +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\is_math_indent 0 +\math_numbering_side default +\quotes_style swiss +\dynamic_quotes 0 +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tracking_changes false +\output_changes false +\html_math_output 0 +\html_css_as_file 0 +\html_be_strict false +\end_header + +\begin_body + +\begin_layout Standard +\align center +\begin_inset Tabular +<lyxtabular version="3" rows="2" columns="2"> +<features tabularvalignment="middle"> +<column alignment="left" valignment="top" width="55text%"> +<column alignment="left" valignment="top" width="35text%"> +<row> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Lenguaje algorítmico +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Pascal +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +LÉXICO +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset Formula $v_{1}$ +\end_inset + +: +\begin_inset Formula $tipo_{1}$ +\end_inset + +; +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset Formula $v_{2},v_{3}$ +\end_inset + + : +\begin_inset Formula $tipo_{2}$ +\end_inset + +; +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset Formula $A_{1}$ +\end_inset + +: una acción +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset space \hspace{} +\length 8ex +\end_inset + +PRE { +\emph on +precondición +\begin_inset Formula $A_{1}$ +\end_inset + + +\emph default + } +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset space \hspace{} +\length 8ex +\end_inset + +POST { +\emph on +postcondición +\begin_inset Formula $A_{1}$ +\end_inset + + +\emph default + } +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + +LÉXICO +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset space \hspace{} +\length 8ex +\end_inset + +... +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + +ALGORITMO +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset space \hspace{} +\length 8ex +\end_inset + +... +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + +FIN +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset Formula $f_{1}$ +\end_inset + +: función +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset space \hspace{} +\length 8ex +\end_inset + +PRE { +\emph on +precondición +\begin_inset Formula $f_{1}$ +\end_inset + + +\emph default + } +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset space \hspace{} +\length 8ex +\end_inset + +POST { +\emph on +postcondición +\begin_inset Formula $f_{1}$ +\end_inset + + +\emph default + } +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + +LÉXICO +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset Formula $\dots$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + +ALGORITMO +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset Formula $\dots$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + +FIN +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + +... +\end_layout + +\begin_layout Plain Layout +ALGORITMO +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + +PRE { +\emph on +precondición algoritmo +\emph default + } +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + +POST { +\emph on +postcondición algoritmo +\emph default + } +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + +... +\end_layout + +\begin_layout Plain Layout +FIN +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\family typewriter +program +\family default + +\begin_inset Formula $nombre$ +\end_inset + + +\family typewriter +; +\end_layout + +\begin_layout Plain Layout + +\family typewriter +type +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset Formula $tipo_{1}$ +\end_inset + + +\family typewriter + = +\begin_inset Formula $\dots$ +\end_inset + +; +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset Formula $tipo_{2}$ +\end_inset + + +\family typewriter + = +\begin_inset Formula $\dots$ +\end_inset + +; +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset Formula $\dots$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout + +\family typewriter +var +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset Formula $v_{1}$ +\end_inset + + +\family typewriter + : +\begin_inset Formula $tipo_{1}$ +\end_inset + +; +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset Formula $v_{2}$ +\end_inset + + +\family typewriter +, +\begin_inset Formula $v_{3}$ +\end_inset + + : +\begin_inset Formula $tipo_{2}$ +\end_inset + +; +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset Formula $\dots$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout + +\family typewriter +procedure +\begin_inset Formula $A_{1}$ +\end_inset + +( +\begin_inset Formula $\dots$ +\end_inset + +): +\end_layout + +\begin_layout Plain Layout + +\family typewriter +var +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset Formula $\dots$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout + +\family typewriter +begin +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset Formula $\dots$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout + +\family typewriter +end; +\end_layout + +\begin_layout Plain Layout + +\family typewriter +function +\begin_inset Formula $f_{1}$ +\end_inset + +( +\family default + +\begin_inset Formula $\dots$ +\end_inset + + +\family typewriter +): +\end_layout + +\begin_layout Plain Layout + +\family typewriter +var +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset Formula $\dots$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout + +\family typewriter +begin +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset Formula $\dots$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout + +\family typewriter +end; +\end_layout + +\begin_layout Plain Layout + +\family typewriter +var +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset Formula $\dots$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout + +\family typewriter +begin +\end_layout + +\begin_layout Plain Layout +\begin_inset space \hspace{} +\length 8ex +\end_inset + + +\begin_inset Formula $\dots$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout + +\family typewriter +end. +\end_layout + +\begin_layout Plain Layout +\begin_inset Note Note +status open + +\begin_layout Plain Layout + +\end_layout + +\end_inset + + +\end_layout + +\end_inset +</cell> +</row> +</lyxtabular> + +\end_inset + + +\end_layout + +\begin_layout Standard +La +\series bold +notación algorítmica +\series default + establece la forma de describir las acciones e informaciones y organizarlas + en el tiempo, mientras que el código del programa establece la forma en + la que estas se implementan de forma interpretable por un ordenador. + Está formado por un +\series bold +léxico, +\series default + donde se definen las informaciones u objetos y las acciones, y el +\series bold +control, +\series default + que establece cómo actúan las acciones sobre los objetos. + La +\series bold +abstracción +\series default + sirve para dominar la complejidad de un programa. +\end_layout + +\begin_layout Section +Tipos de datos y operaciones primitivos +\end_layout + +\begin_layout Standard +Especifican un dominio de valores y un conjunto de operaciones aplicables. + Los tipos pri +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +- +\end_layout + +\end_inset + +mi +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +- +\end_layout + +\end_inset + +ti +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +- +\end_layout + +\end_inset + +vos son: +\end_layout + +\begin_layout Itemize + +\series bold +Entero +\series default + ( +\family typewriter +integer +\family default +). +\end_layout + +\begin_layout Itemize + +\series bold +Real: +\series default + Se usa el +\begin_inset Quotes cld +\end_inset + +. +\begin_inset Quotes crd +\end_inset + + como separador ( +\family typewriter +real +\family default +). +\end_layout + +\begin_layout Itemize + +\series bold +Booleano: +\series default + Valores +\begin_inset Quotes cld +\end_inset + +Verdadero +\begin_inset Quotes crd +\end_inset + + y +\begin_inset Quotes cld +\end_inset + +Falso +\begin_inset Quotes crd +\end_inset + + ( +\family typewriter +boolean +\family default +, +\family typewriter +true +\family default +, +\family typewriter +false +\family default +). +\end_layout + +\begin_layout Itemize + +\series bold +Carácter: +\series default + Se ponen entre comillas simples ( +\family typewriter +char +\family default +). +\end_layout + +\begin_layout Standard +Las operaciones primitivas son: +\end_layout + +\begin_layout Itemize +\begin_inset Formula $-$ +\end_inset + +: Entero +\begin_inset Formula $\rightarrow$ +\end_inset + +Entero, Real +\begin_inset Formula $\rightarrow$ +\end_inset + +Real +\end_layout + +\begin_layout Itemize +\begin_inset Formula $+$ +\end_inset + +, +\emph on + +\begin_inset Formula $-$ +\end_inset + + +\emph default +, +\emph on + +\begin_inset Formula $*$ +\end_inset + + +\emph default +: Entero +\begin_inset Formula $\times$ +\end_inset + +Entero +\begin_inset Formula $\rightarrow$ +\end_inset + +Entero, Real +\begin_inset Formula $\times$ +\end_inset + +Real +\begin_inset Formula $\rightarrow$ +\end_inset + +Real +\end_layout + +\begin_layout Itemize + +\emph on +\begin_inset Formula $/$ +\end_inset + + +\emph default +:Entero +\begin_inset Formula $\times$ +\end_inset + +Entero +\begin_inset Formula $\rightarrow$ +\end_inset + +Real, Real +\begin_inset Formula $\times$ +\end_inset + +Real +\begin_inset Formula $\rightarrow$ +\end_inset + +Real +\end_layout + +\begin_layout Itemize + +\emph on +\begin_inset Formula $DIV$ +\end_inset + + +\emph default +, +\emph on + +\begin_inset Formula $MOD$ +\end_inset + + +\emph default +: Entero +\begin_inset Formula $\times$ +\end_inset + +Entero +\begin_inset Formula $\rightarrow$ +\end_inset + +Entero +\end_layout + +\begin_layout Itemize +\begin_inset Formula $<$ +\end_inset + +, +\begin_inset Formula $>$ +\end_inset + +, +\begin_inset Formula $=$ +\end_inset + +, +\begin_inset Formula $\leq$ +\end_inset + + ( +\family typewriter +<= +\family default +), +\begin_inset Formula $\geq$ +\end_inset + + ( +\family typewriter +>= +\family default +), +\begin_inset Formula $\neq$ +\end_inset + + ( +\family typewriter +<> +\family default +): Entero +\begin_inset Formula $\times$ +\end_inset + +Entero +\begin_inset Formula $\rightarrow$ +\end_inset + +Booleano, Real +\begin_inset Formula $\times$ +\end_inset + +Real +\begin_inset Formula $\rightarrow$ +\end_inset + +Booleano, Carácter +\begin_inset Formula $\times$ +\end_inset + +Carácter +\begin_inset Formula $\rightarrow$ +\end_inset + +Booleano +\end_layout + +\begin_layout Itemize +\begin_inset Formula $Predecesor$ +\end_inset + +, +\begin_inset Formula $Sucesor$ +\end_inset + +: Entero +\begin_inset Formula $\rightarrow$ +\end_inset + +Entero, Carácter +\begin_inset Formula $\rightarrow$ +\end_inset + +Carácter +\end_layout + +\begin_layout Itemize +\begin_inset Formula $Y$ +\end_inset + +, +\begin_inset Formula $O$ +\end_inset + +, +\begin_inset Formula $YDESPUÉS$ +\end_inset + + ( +\family typewriter +and +\family default +), +\begin_inset Formula $ODESPUÉS$ +\end_inset + + ( +\family typewriter +or +\family default +): Booleano +\begin_inset Formula $\times$ +\end_inset + +Booleano +\begin_inset Formula $\rightarrow$ +\end_inset + +Booleano +\end_layout + +\begin_layout Itemize +\begin_inset Formula $NO$ +\end_inset + + ( +\family typewriter +not +\family default +): Booleano +\begin_inset Formula $\rightarrow$ +\end_inset + +Booleano +\end_layout + +\begin_layout Itemize +\begin_inset Formula $Car$ +\end_inset + + ( +\family typewriter +chr +\family default +): Entero +\begin_inset Formula $\rightarrow$ +\end_inset + +Carácter +\end_layout + +\begin_layout Itemize +\begin_inset Formula $Ord$ +\end_inset + + ( +\family typewriter +ord +\family default +): Carácter +\begin_inset Formula $\rightarrow$ +\end_inset + +Entero +\end_layout + +\begin_layout Standard +Las acciones primitivas son: +\end_layout + +\begin_layout Itemize + +\series bold +Asignación: +\series default + +\emph on +Variable +\emph default + +\begin_inset Formula $\leftarrow$ +\end_inset + + +\emph on +Expresión +\emph default +. + Pascal: +\family typewriter +\emph on +var +\emph default + := +\emph on +expr +\family default +\emph default +. +\end_layout + +\begin_layout Itemize + +\series bold +Entrada: +\series default + Leer( +\emph on +lista de variables +\emph default +). + Pascal: +\family typewriter +read( +\emph on +vars +\emph default +) +\family default +, +\family typewriter +readln( +\emph on +vars +\emph default +) +\family default +. +\end_layout + +\begin_layout Itemize + +\series bold +Salida: +\series default + Escribir( +\emph on +lista de expresiones +\emph default +). + Pascal: +\family typewriter +write( +\emph on +exprs +\emph default +) +\family default +, +\family typewriter +writeln( +\emph on +exprs +\emph default +) +\family default +. +\end_layout + +\begin_layout Standard +Todas las declaraciones e instrucciones del léxico y algoritmo terminan + por punto y coma, y cada Entero o Real puede ir acompañado de un rango. + Ejemplos: +\end_layout + +\begin_layout Standard +\align center +\begin_inset Tabular +<lyxtabular version="3" rows="2" columns="2"> +<features tabularvalignment="middle"> +<column alignment="left" valignment="top" width="40text%"> +<column alignment="left" valignment="top" width="40text%"> +<row> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Lenguaje algorítmico +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Pascal +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $m:\text{Entero}[0,59]$ +\end_inset + +; +\end_layout + +\begin_layout Plain Layout +\begin_inset Formula $d:\text{Entero}\geq0$ +\end_inset + +; +\end_layout + +\begin_layout Plain Layout +\begin_inset Formula $c:\text{Caracter}[\text{'a'},\text{'z'}]$ +\end_inset + +; +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\family typewriter +m : 0..59; +\end_layout + +\begin_layout Plain Layout + +\family typewriter +c : 'a'..'z'; +\end_layout + +\begin_layout Plain Layout + +\family typewriter +mes : febrero..abril; +\end_layout + +\end_inset +</cell> +</row> +</lyxtabular> + +\end_inset + + +\end_layout + +\begin_layout Section +Organización de las acciones +\end_layout + +\begin_layout Itemize + +\series bold +Composición secuencial: +\series default + Se introducen estados intermedios para reducir la complejidad, descomponiendo + el problema en subproblemas más simples independientes. +\end_layout + +\begin_layout Itemize + +\series bold +Análisis de casos: +\series default + Se divide el problema en casos según los datos y se resuelve el caso correspond +iente en cada situación. + La precondición de cada problema debe implicar la precondición inicial, + y la postcondición de cada uno debe cumplir la postcondición inicial. + Además, se deben considerar todos los casos como mucho una vez. +\end_layout + +\begin_layout Standard +\align center +\begin_inset Tabular +<lyxtabular version="3" rows="3" columns="2"> +<features tabularvalignment="middle"> +<column alignment="left" valignment="top" width="40text%"> +<column alignment="left" valignment="top" width="40text%"> +<row> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Lenguaje algorítmico +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Pascal +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +SEGÚN +\begin_inset Formula $c_{1},\dots,c_{n}$ +\end_inset + + { Nombres de las variables a comprobar } +\end_layout + +\begin_layout Plain Layout +\begin_inset Formula $e_{1}$ +\end_inset + +: +\begin_inset Formula $a_{1}$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset Formula $\dots$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset Formula $e_{n}$ +\end_inset + +: +\begin_inset Formula $a_{n}$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +EN_OTRO_CASO: +\begin_inset Formula $a_{n+1}$ +\end_inset + + +\begin_inset Formula $_{opcional}$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +FIN_SEGÚN +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +SI +\begin_inset Formula $e$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +ENTONCES +\begin_inset Formula $a$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +SI_NO +\begin_inset Formula $b$ +\end_inset + + +\begin_inset Formula $_{opcional}$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +FIN_SI +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\family typewriter +if +\begin_inset Formula $e$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout + +\family typewriter +then +\begin_inset Formula $a$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +[ +\family typewriter +else +\begin_inset Formula $b$ +\end_inset + + +\family default + ] +\end_layout + +\end_inset +</cell> +</row> +</lyxtabular> + +\end_inset + + +\end_layout + +\begin_layout Standard +En Pascal, los campos de expresiones solo permiten una acción, pero se pueden + agrupar varias en una sola con las etiquetas +\family typewriter +begin +\family default + y +\family typewriter +end +\family default +. + Además, se debe situar un punto y coma ( +\family typewriter +; +\family default +) para separar las acciones. + No es necesario pues introducirlo antes de un +\family typewriter +end +\family default +, ni tampoco debe usarse antes de un +\family typewriter +else +\family default +, pues indicaría el final de la sentencia +\family typewriter +if +\family default + completa. +\end_layout + +\begin_layout Section +Tipos de datos no primitivos +\end_layout + +\begin_layout Standard +Son las +\series bold +tablas, +\series default + los +\series bold +registros +\series default + o +\series bold +producto de tipos +\series default + (estructuras) y las +\series bold +secuencias +\series default +. + Para definir un registro: +\end_layout + +\begin_layout Standard +\align center +\begin_inset Tabular +<lyxtabular version="3" rows="2" columns="2"> +<features tabularvalignment="middle"> +<column alignment="left" valignment="top" width="40text%"> +<column alignment="left" valignment="top" width="40text%"> +<row> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Lenguaje algorítmico +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Pascal +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\emph on +nombre_del_tipo +\emph default + = TIPO < +\begin_inset Formula $a_{1},a_{2}$ +\end_inset + + : +\begin_inset Formula $T_{1}$ +\end_inset + +; +\begin_inset Formula $\dots$ +\end_inset + +; +\begin_inset Formula $a_{n}$ +\end_inset + +: +\begin_inset Formula $T_{m}$ +\end_inset + +>; +\end_layout + +\begin_layout Plain Layout + +\emph on +variable +\emph default + : +\emph on +nombre_del_tipo +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\family typewriter +type +\end_layout + +\begin_layout Plain Layout +\begin_inset space \qquad{} +\end_inset + + +\emph on +nombre_del_tipo +\family typewriter +\emph default + = record +\end_layout + +\begin_layout Plain Layout +\begin_inset space \qquad{} +\end_inset + + +\begin_inset space \qquad{} +\end_inset + + +\begin_inset Formula $a_{1},a_{2}$ +\end_inset + + +\family typewriter + : +\begin_inset Formula $T_{1}$ +\end_inset + +; +\end_layout + +\begin_layout Plain Layout +\begin_inset space \qquad{} +\end_inset + + +\begin_inset space \qquad{} +\end_inset + + +\begin_inset Formula $\dots$ +\end_inset + + +\family typewriter +; +\end_layout + +\begin_layout Plain Layout +\begin_inset space \qquad{} +\end_inset + + +\begin_inset space \qquad{} +\end_inset + + +\begin_inset Formula $a_{n}$ +\end_inset + + +\family typewriter + : +\begin_inset Formula $T_{m}$ +\end_inset + +; +\end_layout + +\begin_layout Plain Layout +\begin_inset space \qquad{} +\end_inset + + +\family typewriter +end; +\end_layout + +\begin_layout Plain Layout + +\family typewriter +var +\end_layout + +\begin_layout Plain Layout +\begin_inset space \qquad{} +\end_inset + + +\emph on +variable +\family typewriter +\emph default + : +\family default +\emph on +nombre_del_tipo +\family typewriter +\emph default +; +\end_layout + +\end_inset +</cell> +</row> +</lyxtabular> + +\end_inset + + +\end_layout + +\end_body +\end_document |
