doc-src/Ref/simplifier.tex
changeset 9445 6c93b1eb11f8
parent 9398 0ee9b2819155
child 9695 ec7d7f877712
equal deleted inserted replaced
9444:13b10be222bf 9445:6c93b1eb11f8
  1089 interpretation $\texttt{sum} \, f \, (n + 1) = \sum@{i=0}^n f\,i$.  We
  1089 interpretation $\texttt{sum} \, f \, (n + 1) = \sum@{i=0}^n f\,i$.  We
  1090 extend \texttt{Arith} as follows:
  1090 extend \texttt{Arith} as follows:
  1091 \begin{ttbox}
  1091 \begin{ttbox}
  1092 NatSum = Arith +
  1092 NatSum = Arith +
  1093 consts sum     :: [nat=>nat, nat] => nat
  1093 consts sum     :: [nat=>nat, nat] => nat
  1094 primrec "sum" nat 
  1094 primrec 
  1095   "sum f 0 = 0"
  1095   "sum f 0 = 0"
  1096   "sum f (Suc n) = f(n) + sum f n"
  1096   "sum f (Suc n) = f(n) + sum f n"
  1097 end
  1097 end
  1098 \end{ttbox}
  1098 \end{ttbox}
  1099 The \texttt{primrec} declaration automatically adds rewrite rules for
  1099 The \texttt{primrec} declaration automatically adds rewrite rules for