Summary For Harrison 91

  • Van Someren (1985) recommends 3 instructional approaches to help students solve or avoid encountered when learning Prolog
    1. Prolog virtual machine which provides novice programmers with good tracing facilities. The virtual machine is the programmer's conceptual model of Prolog. Although these systems provide an excellent debugging environment for more expert Prolog programmers, they are insufficient for novices.
    2. Teaching declarative interpretations of Prolog as opposed to procedural interpretations. This approach is advocated most notably by Kowalski (1984) among others. Although strict adherence to declarative semantics is desired at early stages in learning Prolog, procedural interpretations cannot be totally avoided. (e.g., non-termination of a query computation due to the depth-first, left-to-right search strategy of Prolog).
    3. Teaching how to 'do' algorithms and standard data structures inProlog. Adelson (1981) has shown that a major difference between novice and expert programmers is in their organization of programming concepts. She found that novices tend to use a syntax-based organization, while expert programmers use a more abstract hierarchical organization of algorithms. Van Someren (1990) found that experts' criteria for categorizing Prolog programming exercises was based on the structure of the problems whereas novices tended to categorize the same programming exercises using more superficial criteria.
  • a set of standard structure = program schemata
  • group together sets of programs that share common syntactic features into a single schema. Unlike conventional programming languages, the syntactic structure and the semantic interpretation of two Prolog programs are highly related. This makes it possible to compare the semantic similarity between two Prolog programs by comparing the similarities of their syntactic structures.
  • The major difference between Prolog programs is the type of data structure used (list vs element), the specific predicate used, the number of arguments in a given predicate, and the number and type of goal (or auxiliary) predicates required.
  • 14 Simple Prolog schemata
    1. A - global list processing schema
    2. B - devide-and-conquer schema
    3. C - process before first element occurence
    4. D - process after first element occurrence
    5. E - process before position from front
    6. F - process after position from front
    7. G - process before last element occurrence
    8. H - process after last element occurence
    9. I - process before position from back
    10. J - procvess after position from back
    11. K - process before nth element occurrence
    12. L - process after nth element occurrence
    13. M - process before nth_grom_last_occurrence
    14. N - process after nth_from_last_occurrence
  • Schema-based programming environment consists of 2 components: an ITS and a software development system (SDS) which share a common Knowledge Module and Diagnostic Module.
    • The Knowledge Module contains a library of Prolog schemata which includes the basic schemata, the Prolog programming techniques (Brna et al 1991). The Prolog schema library of the Knowledge Module has 2 major functions: for the novice learning Prolog, the Prolog schema library provides a wealth of Prolog programming examples and techniques which can be tailored to her needs by rearranging the schema hierarchies; for a programmer using SDS, on the other hand, the Prolog schema library provides a warehouse of programming techniques and constructs of structured Prolog.
    • The diagnostic Module is responsible for recognizing the algorithm employed by the programmer, detecting any errors that exist in her program, and suggest corrections for the detected errors. Most program debuggers perform algorithm recognition by searching plan libraries. APROPOS2 (Looi 1988) is a recent Prolog debugger that implements this approach. The basic idea with APROPOS2 (and other plan library approach) i to maintain a plan library of every possible implementation of a given problem. Debugging is then performed by searching the plan library to find the library program that most closely matches the student's program and then detecting errors in the student's program by comparing it to the selected licrary program.
      • Although effective for small classes of problems, this apporoach is limited because of the labor-intensive task of identifying a priori all possible implementations for each problem supported by the system.
      • An alternative to this approach is to maintain canonical form 'model' programs and transform the student's program into this canonical form with a set of quivalence-preserving transformations, e.g., fold/unfold (Tamaki and Sato 1984). Using the basic Prolog schemata as our canonical form, this appears to be a vialbe approach to automated debugging of Prolog programs.
  • interesting references:
    1. Tamaki, H. and Sato, T.(1984) Unfold/foldtransformationoflogicprograms.Proceedings of the 2nd International logic Programming Confecrence, Uppsala, Sweden 127-138
    2. Kowalsi (1984) Logic as a programming language for children. In M. Yazdani (Ed) New horizons in educational computing. New York: John Wiley and Sons.

-- LeNguyenThinh -- 08 Dec 2004
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback