{VERSION 3 0 "IBM INTEL LINUX" "3.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 264 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 266 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 267 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 268 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 269 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 270 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 271 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 272 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 273 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Text Output" -1 2 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 0 1 0 0 0 1 3 0 3 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Hea ding 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 }1 0 0 0 8 4 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 2" 3 4 1 {CSTYLE "" -1 -1 " " 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 8 2 0 0 0 0 0 0 -1 0 } {PSTYLE "" 2 6 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 2 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Warning" 2 7 1 {CSTYLE "" -1 -1 "" 0 1 0 0 255 1 0 0 0 0 0 0 1 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Error" 7 8 1 {CSTYLE "" -1 -1 "" 0 1 255 0 255 1 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 11 12 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Title" 0 18 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 1 0 0 0 0 0 0 }3 0 0 -1 12 12 0 0 0 0 0 0 19 0 }} {SECT 0 {EXCHG {PARA 18 "" 0 "" {TEXT -1 15 "Ladeni programu" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "sit:=proc(n::integer)" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " local i,k,flags,count,twice_i;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " count:=0;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " for i from 2 to n do flags[i]:=true od;" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 21 " for i from 2 to n do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " if flags[i] then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " twice_i:=2*i;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " \+ for k from twice_i by i to n do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " flags[k]=false;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " \+ od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " count:=count+l " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " fi; " }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 4 " od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " count;" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 164 "Jedna se o Erastothenovo sito. Procedura urcuje pocet pr vocisel mensich nebo rovnych zadanemu n. V procedure je zamerne udela no nekolik chyb, ktere mame odstranit." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "sit(6);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,$%\"lG\"\" &" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "showstat(sit);" }} {PARA 6 "" 1 "" {TEXT -1 0 "" }}{PARA 6 "" 1 "" {TEXT -1 23 "sit := pr oc(n::integer)" }}{PARA 6 "" 1 "" {TEXT -1 34 "local i, k, flags, coun t, twice_i;" }}{PARA 6 "" 1 "" {TEXT -1 19 " 1 count := 0;" }} {PARA 6 "" 1 "" {TEXT -1 28 " 2 for i from 2 to n do" }}{PARA 6 " " 1 "" {TEXT -1 26 " 3 flags[i] := true" }}{PARA 6 "" 1 "" {TEXT -1 11 " od;" }}{PARA 6 "" 1 "" {TEXT -1 28 " 4 for i from 2 to n do" }}{PARA 6 "" 1 "" {TEXT -1 26 " 5 if flags[i] \+ then" }}{PARA 6 "" 1 "" {TEXT -1 27 " 6 twice_i := 2*i;" }} {PARA 6 "" 1 "" {TEXT -1 43 " 7 for k from twice_i by i to n \+ do" }}{PARA 6 "" 1 "" {TEXT -1 30 " 8 flags[k] = false" }} {PARA 6 "" 1 "" {TEXT -1 15 " od;" }}{PARA 6 "" 1 "" {TEXT -1 28 " 9 count := count+l" }}{PARA 6 "" 1 "" {TEXT -1 12 " \+ fi" }}{PARA 6 "" 1 "" {TEXT -1 11 " od;" }}{PARA 6 "" 1 "" {TEXT -1 13 " 10 count" }}{PARA 6 "" 1 "" {TEXT -1 3 "end" }} {PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 7 "Pr ikaz " }{TEXT 256 9 "showstat " }{TEXT -1 27 "ocisluje prikazy procedu ry." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 129 "K ladeni potrebujeme spus tit procedura a na nekterem miste ji prerusit. Nastaveni bodu prerusen i (breakpoint) provedeme prikazem " }{TEXT 257 6 "stopat" }{TEXT -1 1 "." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "stopat(sit);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#7#%$sitG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 60 "Tento prikaz nastavil preruseni pred prvni prikaz procedu ry." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "sit(10);" }}{PARA 6 " " 1 "" {TEXT -1 4 "sit:" }}{PARA 6 "" 1 "" {TEXT -1 19 " 1* count \+ := 0;" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 1 "n" }}{PARA 6 "" 1 "" {TEXT -1 2 "10" }}{PARA 6 "" 1 " " {TEXT -1 4 "sit:" }}{PARA 6 "" 1 "" {TEXT -1 19 " 1* count := 0; " }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "next " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 6 "" 1 "" {TEXT -1 1 " 0" }}{PARA 6 "" 1 "" {TEXT -1 4 "sit:" }}{PARA 6 "" 1 "" {TEXT -1 28 " 2 for i from 2 to n do" }}{PARA 6 "" 1 "" {TEXT -1 13 " \+ ..." }}{PARA 6 "" 1 "" {TEXT -1 11 " od;" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 36 "Za promptem (vyzv ou) rezimu ladeni (" }{TEXT 259 4 "DBG>" }{TEXT -1 29 ") se vypisuje r ada informaci:" }}{PARA 0 "" 0 "" {TEXT -1 36 "1. Vysledek predchazeji ciho prikazu." }}{PARA 0 "" 0 "" {TEXT -1 59 "2. Jmeno procedury, jeji z provadeni je zastaveno (zde sit)." }}{PARA 0 "" 0 "" {TEXT -1 74 "3. Cislo prikazu, pred kterym byl beh procedury zastaven spolu s prikaze m." }}{PARA 0 "" 0 "" {TEXT -1 43 "Nejpouzivanejsim prikazem ladeni je prikaz " }{TEXT 260 4 "next" }{TEXT -1 74 ", ktery provede zobrazeny \+ prikaz a zastavi beh procedury pred nasledujicim" }}{PARA 0 "" 0 "" {TEXT -1 26 "prikazem na stejne urovni." }}}{EXCHG {PARA 0 "DBG> " 0 " " {MPLTEXT 1 0 4 "next" }}{PARA 6 "" 1 "" {TEXT -1 4 "true" }}{PARA 6 "" 1 "" {TEXT -1 4 "sit:" }}{PARA 6 "" 1 "" {TEXT -1 28 " 4 for i from 2 to n do" }}{PARA 6 "" 1 "" {TEXT -1 13 " ..." }} {PARA 6 "" 1 "" {TEXT -1 11 " od;" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 54 "Pro skok do vnorene casti \+ procedury pouzijeme prikazu " }{TEXT 261 4 "step" }{TEXT -1 1 "." }}} {EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "step" }}{PARA 6 "" 1 "" {TEXT -1 4 "true" }}{PARA 6 "" 1 "" {TEXT -1 4 "sit:" }}{PARA 6 "" 1 " " {TEXT -1 26 " 5 if flags[i] then" }}{PARA 6 "" 1 "" {TEXT -1 15 " ..." }}{PARA 6 "" 1 "" {TEXT -1 12 " fi" }} {PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "step" }}{PARA 6 "" 1 "" {TEXT -1 4 "true" }}{PARA 6 "" 1 "" {TEXT -1 4 "sit:" }}{PARA 6 "" 1 "" {TEXT -1 27 " 6 twice_i : = 2*i;" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "DBG> " 0 " " {MPLTEXT 1 0 4 "step" }}{PARA 6 "" 1 "" {TEXT -1 1 "4" }}{PARA 6 "" 1 "" {TEXT -1 4 "sit:" }}{PARA 6 "" 1 "" {TEXT -1 43 " 7 for \+ k from twice_i by i to n do" }}{PARA 6 "" 1 "" {TEXT -1 17 " \+ ..." }}{PARA 6 "" 1 "" {TEXT -1 15 " od;" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 8 "show stat" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}{PARA 6 "" 1 "" {TEXT -1 23 "s it := proc(n::integer)" }}{PARA 6 "" 1 "" {TEXT -1 34 "local i, k, fla gs, count, twice_i;" }}{PARA 6 "" 1 "" {TEXT -1 19 " 1* count := 0 ;" }}{PARA 6 "" 1 "" {TEXT -1 28 " 2 for i from 2 to n do" }} {PARA 6 "" 1 "" {TEXT -1 26 " 3 flags[i] := true" }}{PARA 6 "" 1 "" {TEXT -1 11 " od;" }}{PARA 6 "" 1 "" {TEXT -1 28 " 4 \+ for i from 2 to n do" }}{PARA 6 "" 1 "" {TEXT -1 26 " 5 if flag s[i] then" }}{PARA 6 "" 1 "" {TEXT -1 27 " 6 twice_i := 2*i; " }}{PARA 6 "" 1 "" {TEXT -1 43 " 7 ! for k from twice_i by i t o n do" }}{PARA 6 "" 1 "" {TEXT -1 30 " 8 flags[k] = false " }}{PARA 6 "" 1 "" {TEXT -1 15 " od;" }}{PARA 6 "" 1 "" {TEXT -1 28 " 9 count := count+l" }}{PARA 6 "" 1 "" {TEXT -1 12 " fi" }}{PARA 6 "" 1 "" {TEXT -1 11 " od;" }}{PARA 6 "" 1 "" {TEXT -1 13 " 10 count" }}{PARA 6 "" 1 "" {TEXT -1 3 "en d" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 53 "! oznacuje prikaz, pri kterem je procedura prerusena." }}}{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "step" }}{PARA 6 "" 1 "" {TEXT -1 1 "4" }}{PARA 6 "" 1 "" {TEXT -1 4 "sit:" }}{PARA 6 "" 1 "" {TEXT -1 30 " 8 flags[k] = false" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }} }{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "list" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}{PARA 6 "" 1 "" {TEXT -1 23 "sit := proc(n::integer)" }}{PARA 6 "" 1 "" {TEXT -1 34 "local i, k, flags, count, twice_i;" }} {PARA 6 "" 1 "" {TEXT -1 10 " ..." }}{PARA 6 "" 1 "" {TEXT -1 26 " 3 flags[i] := true" }}{PARA 6 "" 1 "" {TEXT -1 11 " \+ od;" }}{PARA 6 "" 1 "" {TEXT -1 28 " 4 for i from 2 to n do" }} {PARA 6 "" 1 "" {TEXT -1 26 " 5 if flags[i] then" }}{PARA 6 "" 1 "" {TEXT -1 27 " 6 twice_i := 2*i;" }}{PARA 6 "" 1 "" {TEXT -1 43 " 7 for k from twice_i by i to n do" }}{PARA 6 " " 1 "" {TEXT -1 30 " 8 ! flags[k] = false" }}{PARA 6 "" 1 "" {TEXT -1 15 " od;" }}{PARA 6 "" 1 "" {TEXT -1 28 " 9 \+ count := count+l" }}{PARA 6 "" 1 "" {TEXT -1 12 " fi" }} {PARA 6 "" 1 "" {TEXT -1 11 " od;" }}{PARA 6 "" 1 "" {TEXT -1 10 " ..." }}{PARA 6 "" 1 "" {TEXT -1 3 "end" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 7 "Prikaz " }{TEXT 262 5 "list " }{TEXT -1 59 "ukazuje pouze predchazejici, aktualni a na sledujici prikaz." }}}{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 7 "outf rom" }}{PARA 6 "" 1 "" {TEXT -1 12 "true = false" }}{PARA 6 "" 1 "" {TEXT -1 4 "sit:" }}{PARA 6 "" 1 "" {TEXT -1 28 " 9 count := \+ count+l" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 7 "Prikaz " }{TEXT 263 8 "outfrom " }{TEXT -1 50 "dokonci vyk onavani prikazu na dane urovni vnoreni." }}}{EXCHG {PARA 0 "DBG> " 0 " " {MPLTEXT 1 0 4 "cont" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,$%\"lG\"\"* " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 7 "Prikaz " }{TEXT 264 4 "cont" } {TEXT -1 134 " dokonci provadeni procedury (pokud nenarazi na dalsi bo d preruseni). Vidime, ze procedura nevraci ocekavany vysledek. Pomoci \+ prikazu " }{TEXT 265 8 "unstopat" }{TEXT -1 23 " zrusime bod preruseni ." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "unstopat(sit);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#7\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 182 "Dalsi moznost ladeni predstavuje nastaveni \"watchpointu\". Wa tchpoint vyvola rezim ladeni kdykoliv Maple modifikuje nejakou promenn ou. K nastaveni \"sledovacich bodu\" pouzijeme prikaz " }{TEXT 258 8 " stopwhen" }{TEXT -1 1 "." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "stopwhen([sit,count]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7#7$%$sitG% &countG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "sit(10);" }} {PARA 6 "" 1 "" {TEXT -1 10 "count := 0" }}{PARA 6 "" 1 "" {TEXT -1 4 "sit:" }}{PARA 6 "" 1 "" {TEXT -1 28 " 2 for i from 2 to n do" }} {PARA 6 "" 1 "" {TEXT -1 13 " ..." }}{PARA 6 "" 1 "" {TEXT -1 11 " od;" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 68 "Beh procedury se prerusi, protoze Maple modifikov al promennou count." }}}{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "co nt" }}{PARA 6 "" 1 "" {TEXT -1 10 "count := l" }}{PARA 6 "" 1 "" {TEXT -1 4 "sit:" }}{PARA 6 "" 1 "" {TEXT -1 26 " 5 if flags[i] then" }}{PARA 6 "" 1 "" {TEXT -1 15 " ..." }}{PARA 6 "" 1 "" {TEXT -1 12 " fi" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "cont" }}{PARA 6 "" 1 "" {TEXT -1 12 "count := 2*l" }}{PARA 6 "" 1 "" {TEXT -1 4 "sit:" }} {PARA 6 "" 1 "" {TEXT -1 26 " 5 if flags[i] then" }}{PARA 6 "" 1 "" {TEXT -1 15 " ..." }}{PARA 6 "" 1 "" {TEXT -1 12 " \+ fi" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 108 "Misto 2 dostavame 2*l. Ze zdrojoveho textu vidime, ze js me pouzili l misto 1. Ladeni ukoncime pomoci prikazu" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }{TEXT 266 5 "quit " }{TEXT -1 25 "a opravime zdrojovy text." }}}{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "quit" }}{PARA 7 "" 1 "" {TEXT -1 32 "Warning, computation interrupted" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "sit:=proc(n::integer)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " local i,k,flags,count,twice_i;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " count:=0;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " for i from 2 to n do flags[i]:=true od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " for i from 2 to n do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " if flags[i] then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " twice_i:=2*i;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " for k from twice_i by i to n do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " flags[k]=false;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " count:=count+1" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " fi; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 " od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " count;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "unstopwhen();" } }{PARA 11 "" 1 "" {XPPMATH 20 "6#7\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "sit(10);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"*" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 196 "Opet nedostavame spravny vysledek , protoze do desitky mame 4 prvocisla (2,3,5,7). Spustime opet rezim \+ ladeni. Protoze zacatek procedury jsme jiz prosli, nastavime bod preru seni na prikaz cislo 6." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " stopat(sit,6);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7#%$sitG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "sit(10);" }}{PARA 6 "" 1 "" {TEXT -1 4 "true" }}{PARA 6 "" 1 "" {TEXT -1 4 "sit:" }}{PARA 6 "" 1 "" {TEXT -1 27 " 6* twice_i := 2*i;" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "step" }}{PARA 6 " " 1 "" {TEXT -1 1 "4" }}{PARA 6 "" 1 "" {TEXT -1 4 "sit:" }}{PARA 6 " " 1 "" {TEXT -1 43 " 7 for k from twice_i by i to n do" }} {PARA 6 "" 1 "" {TEXT -1 17 " ..." }}{PARA 6 "" 1 "" {TEXT -1 15 " od;" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "step" }}{PARA 6 "" 1 "" {TEXT -1 1 "4" }}{PARA 6 "" 1 "" {TEXT -1 4 "sit:" }}{PARA 6 "" 1 "" {TEXT -1 30 " 8 flags[k] = false" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "step" }}{PARA 6 "" 1 "" {TEXT -1 12 "true = false" }}{PARA 6 "" 1 "" {TEXT -1 4 "sit :" }}{PARA 6 "" 1 "" {TEXT -1 30 " 8 flags[k] = false" }} {PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 110 " Posledni krok ukazuje chybu. Vysledkem posledniho prikazu mela byt hod nota false, ale dostali jsme true=false." }}{PARA 0 "" 0 "" {TEXT -1 84 "Misto prirazeni jsme zapsali rovnici. Ukoncime ladeni a opet oprav ime zdrojovy text." }}}{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "qui t" }}{PARA 7 "" 1 "" {TEXT -1 32 "Warning, computation interrupted" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "sit:=proc(n::integer)" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " local i,k,flags,count,twice_i;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " count:=0;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " for i from 2 to n do flags[i]:=true od;" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 21 " for i from 2 to n do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " if flags[i] then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " twice_i:=2*i;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " \+ for k from twice_i by i to n do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 " flags[k]:=false;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " count:=count+1 " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " fi; " }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 4 " od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " count;" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "sit(10);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"%" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 9 "Prikazem " }{TEXT 273 8 "DEBUG() " }{TEXT -1 58 "v tele procedury muzeme nastavovat vlastni body prerusen i." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "f:=proc(x)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "DEBUG(\"muj bod preruseni, hodnota x je: \",x);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "x^2" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "f(3) ;" }}{PARA 6 "" 1 "" {TEXT -1 34 "\"muj bod preruseni, hodnota x je:\" " }}{PARA 6 "" 1 "" {TEXT -1 1 "3" }}{PARA 6 "" 1 "" {TEXT -1 2 "f:" } }{PARA 6 "" 1 "" {TEXT -1 11 " 2 x^2" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}{PARA 7 "" 1 "" {TEXT -1 32 "Warning, computation interrupted" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "quit" }}{PARA 7 "" 1 "" {TEXT -1 32 "Warning, computation interrupted" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "?debugger" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 100 "Dalsi priklad: Napiste proceduru, ktera pocita hodnoty zadaneho p olynomu pro hodnoty z dane mnoziny." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "EvalPolyAt:=proc(S)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " local t,p,x,answer;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " p: =x^4-3*x^3-1;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " answer:=\{\};" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " for t in S do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " x:=t;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " \+ answer:=answer union \{p\};" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " od ;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "RETURN(answer); end:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "EvalPolyAt(\{2, 3, 4\});" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#<#,(*$)%\"xG\"\"%\"\"\"\"\"\"*$)F'\"\" $F)!\"$!\"\"F*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "showstat( EvalPolyAt);" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}{PARA 6 "" 1 "" {TEXT -1 21 "EvalPolyAt := proc(S)" }}{PARA 6 "" 1 "" {TEXT -1 22 "local t, \+ p, x, answer;" }}{PARA 6 "" 1 "" {TEXT -1 25 " 1 p := x^4-3*x^3-1 ;" }}{PARA 6 "" 1 "" {TEXT -1 21 " 2 answer := \{\};" }}{PARA 6 " " 1 "" {TEXT -1 21 " 3 for t in S do" }}{PARA 6 "" 1 "" {TEXT -1 17 " 4 x := t;" }}{PARA 6 "" 1 "" {TEXT -1 39 " 5 answer := `union`(answer,\{p\})" }}{PARA 6 "" 1 "" {TEXT -1 11 " od; " }}{PARA 6 "" 1 "" {TEXT -1 22 " 6 RETURN(answer)" }}{PARA 6 "" 1 "" {TEXT -1 3 "end" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "stopat(EvalPolyAt);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7$%+EvalPolyAtG%\"fG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "EvalPolyAt(\{2,3,4\});" }}{PARA 6 "" 1 "" {TEXT -1 11 "EvalPolyAt:" }}{PARA 6 "" 1 "" {TEXT -1 25 " 1* p := x^4-3*x^3 -1;" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "step" }}{PARA 6 "" 1 "" {TEXT -1 11 "x^4-3*x^3-1" }} {PARA 6 "" 1 "" {TEXT -1 11 "EvalPolyAt:" }}{PARA 6 "" 1 "" {TEXT -1 21 " 2 answer := \{\};" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "step" }}{PARA 6 "" 1 "" {TEXT -1 2 "\{\}" }}{PARA 6 "" 1 "" {TEXT -1 11 "EvalPolyAt:" }}{PARA 6 "" 1 "" {TEXT -1 21 " 3 for t in S do" }}{PARA 6 "" 1 "" {TEXT -1 13 " ..." }}{PARA 6 "" 1 "" {TEXT -1 11 " od;" }} {PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "step" }}{PARA 6 "" 1 "" {TEXT -1 2 "\{\}" }}{PARA 6 "" 1 "" {TEXT -1 11 "EvalPolyAt:" }}{PARA 6 "" 1 "" {TEXT -1 17 " 4 x : = t;" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "step" }}{PARA 6 "" 1 "" {TEXT -1 1 "2" }}{PARA 6 "" 1 "" {TEXT -1 11 "EvalPolyAt:" }}{PARA 6 "" 1 "" {TEXT -1 39 " 5 \+ answer := `union`(answer,\{p\})" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "step" }}{PARA 6 "" 1 "" {TEXT -1 13 "\{x^4-3*x^3-1\}" }}{PARA 6 "" 1 "" {TEXT -1 11 "EvalPolyA t:" }}{PARA 6 "" 1 "" {TEXT -1 17 " 4 x := t;" }}{PARA 6 "" 1 " " {TEXT -1 0 "" }}}{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "step" } }{PARA 6 "" 1 "" {TEXT -1 1 "3" }}{PARA 6 "" 1 "" {TEXT -1 11 "EvalPol yAt:" }}{PARA 6 "" 1 "" {TEXT -1 39 " 5 answer := `union`(answe r,\{p\})" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "step" }}{PARA 6 "" 1 "" {TEXT -1 13 "\{x^4-3*x^3-1 \}" }}{PARA 6 "" 1 "" {TEXT -1 11 "EvalPolyAt:" }}{PARA 6 "" 1 "" {TEXT -1 17 " 4 x := t;" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "step" }}{PARA 6 "" 1 "" {TEXT -1 1 "4" }}{PARA 6 "" 1 "" {TEXT -1 11 "EvalPolyAt:" }}{PARA 6 " " 1 "" {TEXT -1 39 " 5 answer := `union`(answer,\{p\})" }} {PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "step" }}{PARA 6 "" 1 "" {TEXT -1 13 "\{x^4-3*x^3-1\}" }}{PARA 6 "" 1 "" {TEXT -1 11 "EvalPolyAt:" }}{PARA 6 "" 1 "" {TEXT -1 22 " \+ 6 RETURN(answer)" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "step" }}{PARA 11 "" 1 "" {XPPMATH 20 "6 #<#,(*$)%\"xG\"\"%\"\"\"\"\"\"*$)F'\"\"$F)!\"$!\"\"F*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "unstopat(EvalPolyAt);" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#7#%\"fG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "EvalPolyAt:=proc(S::set)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " \+ local t,p,x,answer;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " p:=x^4-3*x^ 3-1;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "answer:=NULL;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "for t in S do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " answer:=answer, subs(x=t,p);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "RETURN([answer]);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "EvalPolyAt(\{2, 3, 4\});" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7%!\"*!\"\"\"#j" }}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 5 "Chyby" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 18 "Globalni promenna " } {TEXT 267 10 "lasterror " }{TEXT -1 34 "uchovava posledni chybove hlas eni." }}{PARA 0 "" 0 "" {TEXT -1 7 "Prikaz " }{TEXT 268 10 "traperror \+ " }{TEXT -1 85 "vyhodnoti svuj argument, pokud nezjisti chybove hlasen i, vraci vyhodnocene argumenty." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "x:=0:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "result:=tra perror(1/(x+1));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%'resultG\"\"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 74 "Pokud pri vyhodnocovani dojde k chybe, vraci odpovidajici chybove hlaseni." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "result:=1/x;" }}{PARA 8 "" 1 "" {TEXT -1 23 "Error , division by zero" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "resul t:=traperror(1/x);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%'resultG%1divi sion~by~zeroG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "lasterror; " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%1division~by~zeroG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 102 "Srovnanim vysledku procedury traperror s hodnotou promenne lasterror muze testovat, zda doslo k chybe." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "evalb(result=lasterror);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#%%trueG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 7 "Prikaz " }{TEXT 269 6 "ERROR " }{TEXT -1 89 "ukoncuje proc eduru (pouziva se pri testovani, zda jsou zadane parametry pozadovaneh o typu" }}{PARA 0 "" 0 "" {TEXT -1 39 "a deklarace parametru je nedost atecna)." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "pairup:=proc(L::list)" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "local i,n;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "n:=nops(L);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "if \+ irem(n,2)=1 then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "ERROR( \"L musi mit sudy pocet prvku\" );" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi;" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "[seq([L[2*i-1],L[2*i]], i=1..n/2)] ;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "pairup([1,2,3,4,5]);" }}{PARA 8 "" 1 "" {TEXT -1 46 "Error, (in pairup) L musi mit sudy pocet prvku" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "pairup([1,2,3,4,5,6]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7%7$\"\"\"\"\"#7$\"\"$\"\"%7$\"\"&\"\"'" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "MEMBER:=proc(x,L) local v;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 "if not type (L,list) then ERROR(\"d ruhy argument musi byt seznam\") fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "for v in L do if v=x then RETURN(true) fi od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "false" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end;" }} {PARA 12 "" 1 "" {XPPMATH 20 "6#>%'MEMBERGR6$%\"xG%\"LG6#%\"vG6\"F+C%@ $4-%%typeG6$9%%%listG-%&ERRORG6#Q?druhy~argument~musi~byt~seznam6\"?&8 $F2%%trueG@$/F:9$-%'RETURNG6#F;%&falseGF+F+F+" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "MEMBER(4,5);" }}{PARA 8 "" 1 "" {TEXT -1 49 "Err or, (in MEMBER) druhy argument musi byt seznam" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 18 "MEMBER(4,[1,2,3]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%&falseG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 35 "Ukonce ni procedury bez vyhodnoceni." }}{PARA 0 "" 0 "" {TEXT -1 29 "Hledani \+ maxima ze dvou cisel:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "MA X:=proc(x,y) if x > y then x else y fi end:" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 57 "Tato procedura ale pracuje pouze s numerickymi hodnotam i:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "MAX(1,Pi);" }}{PARA 8 "" 1 "" {TEXT -1 39 "Error, (in MAX) cannot evaluate boolean" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "MAX:=proc(x,y)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "if type (x,numeric) and type(y, numeric) then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " if x>y then x else y fi;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "else 'MAX'(x,y);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "MAX(1,Pi);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%$MAXG6$\"\"\"%#PiG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "MAX:=proc(x,y)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " if type (x,numeric) and type(y, numeric) then" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " if x>y then x else y fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "else if evalf(x) > evalf(y) then x else y fi;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "MAX(1,Pi);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#%#PiG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 18 "Pouziti Traperror:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "f := u -> (u^2-1)/(u-1);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 231 "for x in [0, 1, 2] do\n r := traperror( f(x) );\n if r = last error then\n if r = `division by zero` then\n r := limit( f(u), u=x);\n else ERROR(lasterror); fi\n fi;\n lprint(`R esult: x =`, x, `f(x) =`, r)\nod;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6# >%\"fGR6#%\"uG6\"6$%)operatorG%&arrowGF(*&,&*$)9$\"\"#\"\"\"\"\"\"!\" \"F3F2,&F0F3F4F3!\"\"F(F(F(" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"rG \"\"\"" }}{PARA 6 "" 1 "" {TEXT -1 29 "Result: x = 0 f(x) = 1" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"rG%1division~by~zeroG" }}{PARA 6 "" 1 "" {TEXT -1 29 "Result: x = 1 f(x) = 2" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"rG\"\"$" }}{PARA 6 "" 1 "" {TEXT -1 29 "Result: \+ x = 2 f(x) = 3" }}}{PARA 4 "" 0 "" {TEXT -1 0 "" }}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 40 "Ladeni procedury v zavislosti na chybach " }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 7 "Prikaz " }{TEXT 270 10 "stoperr or " }{TEXT -1 66 "nastavi preruseni behu procedury v zavislosti na ch ybovem hlaseni." }}{PARA 0 "" 0 "" {TEXT -1 9 "Syntaxe: " }{TEXT 271 27 "stoperror( \"errorMessage\" )" }{TEXT -1 174 ", pri pouziti parame tru \"all\" dojde k preruseni behu procedury pri jakekoliv chybe, para metr \"traperror\" zpusobi preruseni, pokud chyba nastane pri pouziti \+ prikazu traperror." }}{PARA 0 "" 0 "" {TEXT -1 7 "Prikaz " }{TEXT 272 12 "unstoperror " }{TEXT -1 43 "odstrani prerusovani procedury pri chy bach." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "unstoperror();" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#7\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "f:=proc(x) 1/x end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " g:=proc(x) local r;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "r:=traperror (f(x));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "if r=lasterror then infi nity" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "else r" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "fi" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "g(9);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6##\"\"\"\"\"*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "g(0);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%)infinityG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "f(0);" }}{PARA 8 "" 1 "" {TEXT -1 30 "Error, (in f) division by zero" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "stoperror(\"division by zero\");" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7#%1division~by~zeroG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "f(0);" }}{PARA 6 "" 1 "" {TEXT -1 23 "Error, division \+ by zero" }}{PARA 6 "" 1 "" {TEXT -1 2 "f:" }}{PARA 6 "" 1 "" {TEXT -1 11 " 1 1/x" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "DB G> " 0 "" {MPLTEXT 1 0 4 "cont" }}{PARA 8 "" 1 "" {TEXT -1 30 "Error, \+ (in f) division by zero" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 81 "Pokud \+ volame f uvnitr g, pouziti traperror zpusobi, ze rezim ladeni se nespo usti." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "g(0);" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#%)infinityG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 35 "Pouzijme nyni stoperror(traperror)." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "unstoperror(\"division by zero\");" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#7\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "sto perror(\"traperror\");" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7#%*traperro rG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 44 "Ted se beh procedury neprer usi pri volani f." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "f(0);" }}{PARA 8 "" 1 "" {TEXT -1 30 "Error, (in f) division by zero" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 40 "Ale rezim ladeni se spusti pri vol ani g." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "g(0);" }}{PARA 6 " " 1 "" {TEXT -1 23 "Error, division by zero" }}{PARA 6 "" 1 "" {TEXT -1 2 "f:" }}{PARA 6 "" 1 "" {TEXT -1 11 " 1 1/x" }}{PARA 6 "" 1 " " {TEXT -1 0 "" }}}{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "step" } }{PARA 6 "" 1 "" {TEXT -1 23 "Error, division by zero" }}{PARA 6 "" 1 "" {TEXT -1 2 "g:" }}{PARA 6 "" 1 "" {TEXT -1 29 " 2 if r = laste rror then" }}{PARA 6 "" 1 "" {TEXT -1 13 " ..." }}{PARA 6 "" 1 "" {TEXT -1 12 " else" }}{PARA 6 "" 1 "" {TEXT -1 13 " \+ ..." }}{PARA 6 "" 1 "" {TEXT -1 10 " fi" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "step" }} {PARA 6 "" 1 "" {TEXT -1 23 "Error, division by zero" }}{PARA 6 "" 1 " " {TEXT -1 2 "g:" }}{PARA 6 "" 1 "" {TEXT -1 18 " 3 infinity" } }{PARA 6 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "DBG> " 0 "" {MPLTEXT 1 0 4 "step" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%)infinityG" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "unstoperror();" }{TEXT -1 0 "" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7\"" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}}{PARA 3 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}}{MARK "54 0 0" 0 }{VIEWOPTS 1 1 0 3 2 1804 }