1 / 19

Pavel Boytchev www.elica.net

Eurologo 2003, Porto, Portugal. Pavel Boytchev www.elica.net. Error Reporting in Elica. Levels of error information Representing Logo commands Examples. Error Reporting in Elica. Levels of Error Information. Per-line location. Source file name.

trey
Download Presentation

Pavel Boytchev www.elica.net

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Eurologo 2003, Porto, Portugal Pavel Boytchev www.elica.net

  2. Error Reporting in Elica • Levels of error information • Representing Logo commands • Examples

  3. Error Reporting in Elica Levels ofError Information

  4. Per-line location Source file name The other part of ( is missing (Sample1.ELI) OK Help Link to level II Short error message Error Information Level I make"x10make"y20 if:x=:y[ print2*(:x+:y] [ print :x-:y ]

  5. Hints • Context-sensitive • Dynamic • Some errors have 10+ hints • Customizable • Voting subsystem Short, normal and long explanations • Source Reference • Source extract • Source file name and line • Error fragment in red • Hyperlink to actual source • Hyperlink to Level IV for detailed explanation Error Information Level II Pair mismatch (…] • Elica found ( but did not find any matching ). Instead it found ] for which there is no [. • The ( symbol is used to identify the beginning of an expression or a command. The error has been reported because Elica was not able to find the end of the expression or the command which should be marked with ). Instead of ) Elica found the symbol ] which is used to identify the end of a list. An expression and a list could be either nested one in another or independent. They cannot crossintersect. Consider these options: • Check whether there is a mising ) that corresponds to the opening (, or missing [ that already have closing ]; [ VOTE ] • If the symbol ( really starts an expression or a command and the symbol really ends a list, then either the expression must be inside the list [ (…) ], or the list -- inside the expression ( […] ) or both of them not to cross at all (…) […]; [ VOTE ] • If there should be no expression or command in this place of the program then remove or comment (; [ VOTE ] 1 Location: New File 0 (line 3) Explain if :x=:y [print 2*(:x+:y] [print :x-:y]

  6. The actual value that will cause an error Exception will be generated by SIN Place where the error must be fixed The execution of this command will cause an error message Another Error Example • to expr :x :y • print(1+:y)*( sin :x )-count :y • end • to try • local "a "b • make "a random 1 • make "b random 1 • expr "a :b • end • try

  7. Action name, hyperlink to its definition and its local variables Error Information Level III Location: New File 0 (line 10) Action: trydefinitioninputs 4 Explain try Location: New File 0 (line 8) Action: exprdefinitioninputs 3 Explain expr "a :b Location: New File 0 (line 2) Action: sindefinitioninputs 2 Explain print (1+:y)*(sin :x)-count :y 1 Explain Location: Logo.eli (line 207) to logo.sin :angle output dll.logo.logosin end

  8. Error Reporting in Elica RepresentingLogo CommandsError Information Level IV

  9. Original Logo source: Error located within the shortest source region print (1+:y)*(sin :x)-count :y Logo source with parentheses: Colors used to easily match parentheses (print (((1+:y)*(sin :x))-(count :y))) print (1+:y)*(sin :x)-count :y

  10. 1 :y :x x y angle :y + sin x y thing count * x y thing print print (1+:y)*(sin :x)-count :y Brace notation (Function Machines): Shows inputs names, visualizes expression trees

  11. 1 :y :x :y print + * sin count print (1+:y)*(sin :x)-count :y Box notation (Boxer): Shows function nesting

  12. print (1+:y)*(sin :x)-count :y (print (logo.- (logo.* (logo.+ 1 :y ) (logo.sin :x ) ) (logo.count :y ) )) Lisp notation: Converts source to prefix notation, shows complete names of functions

  13. print (1+:y)*(sin :x)-count :y Assembler notation: Reveals internal compiled code, full function names, number of actual inputs and special cases (like treating : as a function) PUSH 1 PUSH y CALL :1 CALL logo.+2 PUSH x CALL :1 CALL logo.sin1 CALL logo.*2 PUSH y CALL :1 CALL logo.count1 CALL logo.-2 CALL print1 POPRET

  14. Natural language: Converts Logo source to English (using parenthesised English) Print the difference of X1 and the number of elements in the value of y, where X1 is the product of X2 and the sine of the value of x. X2 is the sum of 1 and the value of y. print (1+:y)*(sin :x)-count :y Seminatural language: Converts Logo source into a parenthesised English statement. Print (the difference of (the product of (the sum of 1 and (the value of y)) and (the sine of (the value of x))) and (the number of elements in (the value of y))).

  15. Logo-to-Natural Language • Translation entirely done by a Logo program • can be inspected and modified • AI/NLP module used to naturalize language: • controls desired sentence length and depth • splits sentences to keep readibility higher (number of ANDs, THATs, subject-object confusion, etc) • easy to teach AI/NLP module to handle new user-defined commands and functions

  16. Identical header, different body Make a variable with name the text a and set its value to the number of elements in the reversed list of the list [1 2 three 4 5] without its first element. Teaching the AI/NLP Module to reverse :lst if ... end oninspector.add [ to reverse :lst output list se [the reversed list of] :lst end ] make "a count reverse bf [12 three 45]

  17. Logo Representations Tree

  18. More Examples Real-time examples of how Elica behaves in some error conditions

More Related