TEACH SEM1A3 Aaron Sloman September 1995 THE SEM1A3 COURSE Artificial Intelligence Programming in POP-11 (Year 1, Semester 1) This is the practical component of the first semester of the AI degree course. The course is assessed by a mini-project to be done at the end of the semester. It is followed by a course in Prolog programming (SEM1A4). CONTENTS -- OBJECTIVES OF THIS COURSE -- TIME ALLOCATION 6.5 hours per week per module -- SPECIFIC SYLLABUS -- 1. LEARNING TO USE THE POPLOG DEVELOPMENT ENVIRONMENT. -- 2. INTRODUCTION TO UNIX. -- 3. PROGRAMMING AND POP-11 -- 4. THE IDEA OF SOFTWARE ENGINEERING DISCIPLINE -- 5. AI CONCEPTS AND TECHNIQUES -- 6. MINI PROJECTS -- 7. PROVISIONAL COURSE TIMETABLE -- -- Week 1 -- -- Week 2 -- -- Week 3 -- -- Week 4 -- -- Week 5 -- -- Week 6 -- -- Week 7 -- -- Week 8 -- -- Week 9 -- -- Week 10 -- -- Week 11 -- -- Week 12 of semester 1 (Week 1 of term 2) -- Further background reading -- -- Online documentation -- -- Books -- OBJECTIVES OF THIS COURSE These objectives are not listed in chronological order. 1. To introduce general and AI-specific programming concepts and techniques, based on Pop-11 in semester 1 (to be followed by Prolog in semester 2). Students learn how to get knowledge about a problem into useful form for solving the problem. This may be factual knowledge (knowledge that something is the case) or procedural knowledge (knowledge how to do something). 2. To support, by means of examples and/or project work the AI content of the other courses the students are doing especially: Introduction to AI and Cognitive Science (SEM1A1) Introduction to Expert Systems (Applied AI) (SEM1A2) 3. To introduce relevant software engineering/software development skills including: producing a proposal, planning a program, specifying a program, testing, tracing, debugging, writing reports (including user documentation, system documentation), reporting verbally (i.e. giving presentations on programs), working with other students. 4. To introduce students to a minimal useful subset of the Unix + X window environment, and the facilities provided, including files, directories, mail and others. NB. The programming skills and concepts are selected because of their potential relevance to developing explanations for complex human capabilities and simulating those abilities in applications of AI. This requires learning how to represent information in a useful form, and how to specify processes that use the information. It is not assumed that you have done any previous programming. However, students without programming experience may have to spend extra time practising. NOTE: students doing the AI and Computer Science degree will simultaneously be learning C++, using PCs instead of Unix machines. -- TIME ALLOCATION 6.5 hours per week per module Students will have to accept responsibility for allocating their time between this and other courses. 6.5 hours per week is a MINIMUM requirement for doing well on thise course. Most of the programming work will be done in laboratories, where research students will be availalable as ``demonstrators'' some of the time. The language used does not run on a PC unless you run the Linux operating system. It may be available for a low charge from the developers. -- SPECIFIC SYLLABUS The course will include the following components: -- 1. LEARNING TO USE THE POPLOG DEVELOPMENT ENVIRONMENT. POPLOG is a sophisticated software development environment produced originally at Sussex University and marketed internationally by Integral Solutions Ltd. It includes several languages (POP-11, Prolog, Common Lisp, Standard ML), an integrated general purpose text editor VED, a graphical library, and many teaching and demonstration libraries connected with Artificial Intelligence and Cognitive Science. The course involves the following in the first semester. 1.a. Learning to use VED as a general purpose text editor and browser, and also as a mail front end and program debugging tool. This includes learning how to read TEACH files and HELP files. 1.b. Learning to print whole files or marked range. See HELP VED_PSPRINT 1.c. Learning about the structure of the online documentation on VED, Pop-11 and AI, and how to browse documentation using VED. 1.d. Function keys and ENTER commands will be used, but a "menu" facility will be available to reduce your learning load. 1.e. Learning to do simple text formatting using VED's built in commands. (See HELP RNO, HELP LATEX, HELP VED_LATEX) 1.f. Reading and sending electronic mail in the editor VED. -- 2. INTRODUCTION TO UNIX. Some students will also learn the following: 2.a. The concept of an operating system and its relation to a language system like Poplog, logging in, files, and the network. 2.b. The Unix file structure. Use of pwd, ls, mkdir, cd, chmod, and perhaps symbolic links so that students can easily share files. 2.c. Man(ual) files: their structure and their use. (Accessible via VED) -- 3. PROGRAMMING AND POP-11 In the first semester the language to be used is Pop-11. This language is very similar to the more commonly used language Lisp, in power, but POP-11 is generally found easier to read, and to learn. In the second semester you will learn Prolog, a logic-based language. Topics you will learn include the following: 3.a. The idea of a programming language, with a semantics and syntax. 3.b. The main data-structures used for the course: Words, strings, numbers, lists, vectors, procedures, and possibly arrays, if there is time. The use of lists as patterns, and as databases. The implementation of list structures as chained pairs (See online files: TEACH LISTS, TEACH BOXES) 3.c. The main syntactic forms required for the course. procedure definitions procedure calls conditionals, loops, return, and abnormal loop exits. declarations: global and local, dynamic and lexical assignments to variables or contents of data structures. syntax for various data-types, especially numbers, words, strings, lists, patterns and possibly also vectors. See TEACH POPCORE 3.d. The use of iteration (loops) and recursion (procedures that use themselves as sub-procedures). 3.e. The use of the pattern matcher and the Pop-11 database (See TEACH MATCHES, TEACH DATABASE) 3.f. "Trace" and the Pop-11 debugger. 3.i. How to organise program files, test files, and produce sample output to be included in reports. 3.j. How to produce a program that solves a problem by searching for a solution. 3.k. A brief introduction to some concepts of grammar and parsing. 3.l. Optional extra for more advanced students: Object oriented programming (inheritance hierarchies and methods) TEACH OBJECTCLASS_EXAMPLE, TEACH ADVENT_OBJECTCLASS -- 4. THE IDEA OF SOFTWARE ENGINEERING DISCIPLINE This includes 4.a. Specifying what a program is going to do (Ontology, behavioural specification, scenario). See TEACH PROPOSALS 4.b. Writing reports on programs. See TEACH REPORTS -- 5. AI CONCEPTS AND TECHNIQUES 5.a. The importance of representation. Alternative ways of representing the same information (in the machine or the brain). E.g. alternative ways of representing information about the "river" problem. Tradeoffs between explicitness and complexity of changes. General purpose vs domain-specific or problem-specific representations (e.g. lists as analogical representations). Logical representations vs "ad hoc"(?) representations 5.b. The flexibility of lists and pattern matching for representing and relating very varied forms of data. 5.c. Using lists to specify not only particular facts but also general knowledge (e.g. grammatical rules, rules to be used by a planning program.) 5.d. Processing strategies: the importance of search in AI. Different kinds of search: Different kinds of search: searching for an item that already exists, in some list or network searching for something that has to be created, e.g. a new plan. 5.e. Search patterns: depth first, breadth first, heuristic search 5.f. The importance of good representations in controlling search TEACH TOWER, TEACH SEARCHING 5.h. Parsing and grammars: TEACH GRAMMAR 5.i. Other techniques used in AI (If there is time.) Use of production systems for expert systems: TEACH EXPERTS Use of scripts and schemata: TEACH SCHEMATA There are many additional teach files for ambitious students; to. -- 6. MINI PROJECTS The course will be assessed by means of a mini project, to be specified later. Students will write a proposal, then do the projet and write a report. The assessment will be based more on the written report than on the program code. E.g. clarity of explanation, analysis of problems, description of inadequacies in the program, etc. will all play an important role in the assessment. NOTE: There is a lot to learn and not everyone will cover all the material. It will be possible for students who are new to computing to cover less material than those with more experience. This can be compensated for in other ways, during your three years here. -- 7. PROVISIONAL COURSE TIMETABLE Each week there will be set times for laboratory classes at which help will be available. Laboratory class times are currently arranged for Friday afternoons 2pm onwards, in room G10, the Unix lab, on the ground floor of Aston Webb C block (the same level as the main entrance). Lectures are Wednesdays 11am in G12. Several times a term you will obtain report forms for specific assignments. You will need to get a demonstrator to check your assignment and sign the form which you will then hand in. This will provide a check on your progress and should help students who find the work difficult. -- -- Week 1 Overview, followed by introduction to logging in and VED+X as an interface Students will start to use VED, mail, unix, playing with Eliza and simple programming a. Introductory VED files TEACH TEACH, TEACH VED, TEACH MARK, TEACH LMR, TEACH VEDPOP Information about keyboard maps on the NCD X terminals and Sun workstations can be found in HELP NCDXTERMKEYS, HELP SUNXTERMKEYS, HELP SUN4KEYS b. Play with Eliza and try to work out Eliza's rules and where they fail, and why. Students with previous programming experience try TEACH GSTART -- -- Week 2 Lecture: on what a programming language is and how Pop-11 fits in. A language has syntax and semantics (virtual machine) Main facilities in Pop-11 and similar AI development environments: data-types, pattern matcher, control structures, (incremental compilation?), AI tools. a. Continue developing fluency with VED, and practice using mail. b. Use TEACH RIVER to get an introduction to problem solving and to notions of procedure, procedure parameters. TEACH DEFINE, If fluent, try TEACH GSTART -- -- Week 3 a. Use TEACH RESPOND to develop a mini-eliza program, learning about conditionals, the matcher, variables. b. Teach files on Programming. A subset of: TEACH DEFINE, TEACH LISTS, TEACH MATCHES, TEACH VARS, TEACH POPCORE, HELP IF -- -- Week 4 a. Students who have not finished TEACH RESPOND do so. b. Those who have, start on TEACH GRAMMAR up to the train announcement example. Try to produce your own grammar and lexicon for either railway announcements or newspaper headlines. -- -- Week 5 Start working on TEACH RIVER2 -- -- Week 6 Continue TEACH RIVER2 Advanced students can try TEACH RIVERCHAT -- -- Week 7 Introduction to searching TEACH TOWER (How to build a tower of a specified size). -- -- Week 8 Continue TEACH TOWER. More advanced students: TEACH SEARCHNG -- -- Week 9 Rule-based programming exercise. A mini expert system. Students start to think about mini project: TEACH PROPOSALS -- -- Week 10 Programming revision. Go back to earlier exercises and catch up. Read the Pop-11 primer. Work on mini-project Prepare a design specification (as in TEACH PROPOSALS) -- -- Week 11 Work on mini-project -- -- Week 12 of semester 1 (Week 1 of term 2) Work on mini-project (Submission date first day of next term). -- Further background reading -- -- Online documentation TEACH * POPCORE (Printed version will be handed out) Very similar to appendix on Pop-11 in the Sharples et. al. book TEACH * POPSUMMARY This is a more extended overview of Pop-11 (needs some updating) TEACH * PRIMER This gives an extensive overview of many aspects of Pop-11. Copies will be made available in the laboratory and in the library, for browsing. A printed version can be bought for 3 pounds. There are many online REF files, HELP files and TEACH files with extensive documenation on Pop-11, the Editor, and the libraries. Part of what students need to learn is how to find their way round these files. -- -- Books In addition to the Pop-11 primer, there are books mentioned in the general reading list, including: M.Sharples et. al. (1989) Computers and Thought, MIT Press The School Library has some copies of the Poplog User Guide, which can be read in the Library, if you are feeling adventurous. --- $poplocal/local/teach/sem1a3 --- The University of Birmingham 1995. --------------------------------