Codewarrior Programming Practice: Pascal Codewarrior

Total Page:16

File Type:pdf, Size:1020Kb

Codewarrior Programming Practice: Pascal Codewarrior CD TM CodeWarrior Programming Practice: Pascal CodeWarrior Metrowerks Because of last-minute changes to CodeWarrior, some information in this manual may be out of date. Please read all the Release Notes files that come with CodeWarrior for the latest information. Metrowerks CodeWarrior Copyright ©1993-1995 by Metrowerks Inc. and its Licensors. All rights reserved. Documentation stored on the compact disc may be printed by licensee for personal use. Except for the foregoing, no part of this documentation may be reproduced or transmitted in any form by any means, electronic or mechanical, including photocopying, recording, or any information storage and retrieval system, without permission in writing from Metrowerks Inc. Metrowerks, the Metrowerks logo and Software at Work are registered trademarks of Metrowerks Inc. CodeWarrior, PowerPlant, and PowerPlant Constructor are trademarks of Metrowerks Inc. All other trademarks or registered trademarks are the property of their respective owners. ALL SOFTWARE AND DOCUMENTATION ON THE COMPACT DISC ARE SUBJECT TO THE LICENSE AGREEMENT IN THE CD BOOKLET. Canada and International U.S.A. Metrowerks Inc. Metrowerks Corporation 1500 du College, suite 300 Suite 310 St. Laurent, QC The MCC Building H4L 5G6 Canada 3925 West Braker Lane Austin, TX 78759-5321 voice: (514) 747-5999 voice: 512-305-0400 fax: (514) 747-2822 fax: 512-305-0440 Metrowerks Mail Order voice: (800) 377-5416 or (419) 281-1802 fax: (419) 281-6883 World Wide Web site (Internet): http://www.metrowerks.com Registration information (Internet): [email protected] Technical support (Internet): [email protected] Sales, marketing, & licensing (Internet): [email protected] AppleLink: METROWERKS America OnLine: goto: METROWERKS Compuserve: goto: METROWERKS eWorld: goto: METROWERKS Table of Contents iii Table of Contents Chapter 1 An Overview 1.1 Preview....................................................................14 1.2 Introduction to Programming Practice: Pascal...........15 A Global View.........................................................15 The Road Ahead.......................................................15 Signs Along the Road...............................................16 1.3 Hardware: Computers and Peripherals.....................17 The CPU...................................................................18 Other Components and Packaging............................19 1.4 The World of Programming......................................20 What is Programming?.............................................20 “Real world” and “Abstract World”..........................20 1.5 Pascal.......................................................................21 An example Pascal program......................................22 Running Programs: Compiling, Linking, Executing.23 1.6 Communicating to Computers..................................24 Typing......................................................................24 1.7 Chapter 1 Review.....................................................27 Chapter 2 Computing: A Short Survey of Some Applications 2.1 Preview....................................................................30 2.2 Software and Applications........................................30 2.3 Application Software................................................33 Editor Application....................................................34 Typing Applications.................................................35 Calculator Applications.............................................36 Retrieve Application: A Tiny Database.....................38 Planner-Calendar Application...................................39 Bar Plot Application..................................................41 Drill Application.......................................................42 SSS: Small and Simple Spreadsheet...........................43 2.4 Chapter 2 Review.....................................................47 Chapter 3 Programming Language: Pascal 3.1 Preview....................................................................50 iv Table of Contents 3.2 Languages................................................................50 Syntax and Semantics................................................50 Syntax Diagrams.......................................................53 3.3 Pascal Programs........................................................56 Program Format.......................................................56 Program Presentation................................................59 More Pascal Programming: Data and Actions..........60 Data Items................................................................61 Actions: Arithmetic Operations................................63 3.4 More Example Programs...........................................66 3.5 Chapter 3 Review.....................................................69 3.6 Chapter 3 Problems...................................................70 3.7 Chapter 3 Programming Project................................74 Getting Acquainted...................................................74 Chapter 4 Data and Actions 4.1 Preview....................................................................76 4.2 Programming: Data and Actions...............................76 Declarations: Syntax Diagrams from the Bottom........76 Simple Input and Output in Pascal............................80 4.3 More Programs: A Top View of Pascal....................83 4.4 Programming Style...................................................85 4.5 Layout of Programs..................................................86 4.6 More Programs: Continued.......................................89 Actions: Pre-Defined Standard Functions in Pascal....89 Libraries: Using Units in Pascal.................................92 4.7 A Foretaste of Procedures.........................................94 4.8 Chapter 4 Review.....................................................96 4.9 Chapter 4 Problems...................................................96 4.10 Chapter 4 Programming Projects...............................97 Generate Conversion Tables......................................97 Observing Errors......................................................97 Demilitarize Time.....................................................98 TipTable...................................................................99 STT: Sales Tax Table..................................................100 SSP: Simple Side Plot................................................101 Chapter 5 The Four Fundamental Forms in Pascal 5.1 Preview....................................................................105 Table of Contents v 5.2 The Sequence Form in Pascal....................................105 5.3 Conditions in Pascal..................................................107 5.4 Repetition Form: The WHILE statement....................108 Tracing Loops...........................................................110 5.5 WHILES, REALS, and Errors.....................................114 5.6 Selection Forms in Pascal..........................................117 5.7 More Selections: Combinations of Selection Forms....119 Confusion in Choices................................................120 More Nesting of Choices..........................................120 Alternative Ways to Code Selections.........................121 5.8 Select Form: Handling Many Branches....................124 5.9 Awkward Nests: General Nesting............................127 Mixed Nests: Repetition and Selections.....................128 5.10 Subprograms: Using Subprograms as Black Boxes....130 The ShortSort Library................................................134 Notation for Defined Procedures...............................137 Procedures vs. Functions..........................................140 5.11 Binary Logic Library: BitLib.....................................145 5.12 Chapter 5 Review.....................................................149 5.13 Chapter 5 Problems...................................................150 5.14 Chapter 5 Programming Problems............................152 Sequence Problems...................................................153 Selection Problems....................................................153 Loop Problems.........................................................153 Subprogram Problems..............................................153 Debugging Problems................................................154 Selection Programs...................................................156 Procedures and Repetitions.......................................157 Josephus’ Problem....................................................158 5.15 Chapter 5 Programming Projects...............................159 Project A: Change Change.......................................159 Project B: Payroll.....................................................160 Project C: Quadratic Roots.......................................160 Project D: Digital Circuits.........................................160 Project E: Roll Your Own.........................................161 CRN: Convert Roman Numbers..............................161 GPR: Growing Pay Roll...........................................161 MWM: Many Ways to Mid......................................162 DFP: Data Flow Programming.................................163 Chapter 6 Pascal with Bigger Blocks 6.1 Preview....................................................................169 vi Table of Contents 6.2 Conglomerations......................................................169
Recommended publications
  • PL/SQL Multi-Diagrammatic Source Code Visualization
    SQLFlow: PL/SQL Multi-Diagrammatic Source Code Visualization Samir Tartir Ayman Issa Department of Computer Science University of the West of England (UWE), University of Georgia Coldharbour Lane, Frenchay, Bristol BS16 1QY Athens, Georgia 30602 United Kingdom USA Email: [email protected] Email: [email protected] ABSTRACT: A major problem in software introducing new problems to other code that was perfectly maintenance is the lack of a well-documented source code working before. Therefore, educating programmers about in software applications. This has led to serious the behaviors of the target code before start modifying it difficulties in software maintenance and evolution. In is not an easy task. Source code visualization is one of the particular, for those developers who are faced with the heavily used techniques in the literature to overcome this task of fixing or modifying a piece of code they never lack of documentation problem, and its consequent even knew existed before. Database triggers and knowledge-sharing problem [7, 9]. procedures are parts of almost every application, are typical examples of badly documented software Therefore, this research aims at investigating the current components being the hidden back end of software database source code visualization tools and identifying applications. Source code visualization is one of the the main open issues for research. Consequently, the heavily used techniques in the literature so as to mostly used PL/SQL database programming language has familiarize software developers with new source code, been selected for a flowcharting reverse engineering and compensate for the knowledge-sharing problem. prototype tool called "SQLFlow". SQLFlow has been Therefore, a new PL/SQL flowcharting reverse designed, implemented, and tested to parse the target engineering tool, SQLFlow, has been designed and PL/SQL code stored in database procedures, analyze its developed.
    [Show full text]
  • Create a Program Which Will Accept the Price of a Number of Items. • You Must State the Number of Items in the Basket
    PROBLEM: Create a program which will accept the price of a number of items. • You must state the number of items in the basket. • The program will then accept the unit price and the quantity for each item. • It must then calculate the item prices and the total price. • The program must also calculate and add a 5% tax. • If the total price exceeds $450, a discount of $15 is given to the customer; else he/she pays the full amount. • Display the total price, tax, discounted total if applicable, as well as the total number of items bought. • A thank you message must appear at the bottom. SOLUTION First establish your inputs and your outputs, and then develop your IPO chart. Remember: this phase is called - Analysis Of The Problem. So what are your inputs & output? : Variable names: Number of items (input & output) Num (Assume there are 4 items) Unit price of each item (input) Price1, Price2, Price3, Price4 Quantity of each item (Input) Quan1, Quan2, Quan3, Quan4 Total price (output) TotPrice Tax amount (output) Tax Discounted total price (output) DiscTotPrice In your IPO chart, you will describe the logical steps to move from your inputs to your outputs. INPUT PROCESSING OUTPUT Price1, Price2, 1. Get the number of items TotPrice, Tax, Price3, Price4, 2. Get the price and quantity of the each item DiscTaxedTotal, Num 3. Calculate a sub-total for each item TaxedTotal Quan1, Quan2, 4. Calculate the overall total Num Quan3, Quan4 5. Calculate the tax payable {5% of total} 6. If TaxedTotal > 450 then Apply discount {Total minus 15} Display: TotPrice, Tax, DiscTaxedTotal, TaxedTotal, Num Else TaxedTotal is paid Display: TotPrice, Tax, TaxedTotal, Num Note that there are some variables that are neither input nor output.
    [Show full text]
  • A Prolog-Based Proof Tool for Type Theory Taλ and Implicational Intuitionistic-Logic
    A Prolog-based Proof Tool for Type Theory TAλ and Implicational Intuitionistic-Logic L. Yohanes Stefanus University of Indonesia Depok 16424, Indonesia [email protected] and Ario Santoso∗ Technische Universit¨atDresden Dresden 01187, Germany [email protected] Abstract Studies on type theory have brought numerous important contributions to computer science. In this paper we present a GUI-based proof tool that provides assistance in constructing deductions in type theory and validating implicational intuitionistic-logic for- mulas. As such, this proof tool is a testbed for learning type theory and implicational intuitionistic-logic. This proof tool focuses on an important variant of type theory named TAλ, especially on its two core algorithms: the principal-type algorithm and the type inhabitant search algorithm. The former algorithm finds a most general type assignable to a given λ-term, while the latter finds inhabitants (closed λ-terms in β-normal form) to which a given type can be assigned. By the Curry{Howard correspondence, the latter algorithm provides provability for implicational formulas in intuitionistic logic. We elab- orate on how to implement those two algorithms declaratively in Prolog and the overall GUI-based program architecture. In our implementation, we make some modification to improve the performance of the principal-type algorithm. We have also built a web-based version of the proof tool called λ-Guru. 1 Introduction In 1902, Russell revealed the inconsistency in naive set theory. This inconsistency challenged the foundation of mathematics at that time. To solve that problem, type theory was introduced [1, 5]. As time goes on, type theory becomes widely used, it becomes a logician's standard tool, especially in proof theory.
    [Show full text]
  • Develop-21 9503 March 1995.Pdf
    develop E D I T O R I A L S T A F F T H I N G S T O K N O W C O N T A C T I N G U S Editor-in-Cheek Caroline Rose develop, The Apple Technical Feedback. Send editorial suggestions Managing Editor Toni Moccia Journal, a quarterly publication of or comments to Caroline Rose at Technical Buckstopper Dave Johnson Apple Computer’s Developer Press AppleLink CROSE, Internet group, is published in March, June, [email protected], or fax Bookmark CD Leader Alex Dosher September, and December. develop (408)974-6395. Send technical Able Assistants Meredith Best, Liz Hujsak articles and code have been reviewed questions about develop to Dave Our Boss Greg Joswiak for robustness by Apple engineers. Johnson at AppleLink JOHNSON.DK, His Boss Dennis Matthews Internet [email protected], CompuServe This issue’s CD. Subscription issues Review Board Pete “Luke” Alexander, Dave 75300,715, or fax (408)974-6395. Or of develop are accompanied by the Radcliffe, Jim Reekes, Bryan K. “Beaker” write to Caroline or Dave at Apple develop Bookmark CD. The Bookmark Ressler, Larry Rosenstein, Andy Shebanow, Computer, Inc., One Infinite Loop, CD contains a subset of the materials Gregg Williams M/S 303-4DP, Cupertino, CA 95014. on the monthly Developer CD Series, Contributing Editors Lorraine Anderson, which is available from APDA. Article submissions. Ask for our Steve Chernicoff, Toni Haskell, Judy Included on the CD are this issue and Author’s Guidelines and a submission Helfand, Cheryl Potter all back issues of develop along with the form at AppleLink DEVELOP, Indexer Marc Savage code that the articles describe.
    [Show full text]
  • LIGO Data Analysis Software Specification Issues
    LASER INTERFEROMETER GRAVITATIONAL WAVE OBSERVATORY - LIGO - CALIFORNIA INSTITUTE OF TECHNOLOGY MASSACHUSETTS INSTITUTE OF TECHNOLOGY Document Type LIGO-T970100-A - E LIGO Data Analysis Software Specification Issues James Kent Blackburn Distribution of this draft: LIGO Project This is an internal working document of the LIGO Project. California Institute of Technology Massachusetts Institute of Technology LIGO Project - MS 51-33 LIGO Project - MS 20B-145 Pasadena CA 91125 Cambridge, MA 01239 Phone (818) 395-2129 Phone (617) 253-4824 Fax (818) 304-9834 Fax (617) 253-7014 E-mail: [email protected] E-mail: [email protected] WWW: http://www.ligo.caltech.edu/ Table of Contents Index file /home/kent/Documents/framemaker/DASS.fm - printed July 22, 1997 LIGO-T970100-A-E 1.0 Introduction The subject material discussed in this document is intended to support the design and eventual implementation of the LIGO data analysis system. The document focuses on raising awareness of the issues that go into the design of a software specification. As LIGO construction approaches completion and the interferometers become operational, the data analysis system must also approach completion and become operational. Through the integration of the detector and the data analysis system, LIGO evolves from being an operational instrument to being an operational grav- itational wave detector. All aspects of software design which are critical to the specifications for the LIGO data analysis are introduced with the preface that they will be utilized in requirements for the LIGO data analysis system which drive the milestones necessary to achieve this goal. Much of the LIGO data analysis system will intersect with the LIGO diagnostics system, espe- cially in the areas of software specifications.
    [Show full text]
  • Constructing Algorithms and Pseudocoding This Document Was Originally Developed by Professor John P
    Constructing Algorithms and Pseudocoding This document was originally developed by Professor John P. Russo Purpose: # Describe the method for constructing algorithms. # Describe an informal language for writing PSEUDOCODE. # Provide you with sample algorithms. Constructing Algorithms 1) Understand the problem A common mistake is to start writing an algorithm before the problem to be solved is fully understood. Among other things, understanding the problem involves knowing the answers to the following questions. a) What is the input list, i.e. what information will be required by the algorithm? b) What is the desired output or result? c) What are the initial conditions? 2) Devise a Plan The first step in devising a plan is to solve the problem yourself. Arm yourself with paper and pencil and try to determine precisely what steps are used when you solve the problem "by hand". Force yourself to perform the task slowly and methodically -- think about <<what>> you are doing. Do not use your own memory -- introduce variables when you need to remember information used by the algorithm. Using the information gleaned from solving the problem by hand, devise an explicit step-by-step method of solving the problem. These steps can be written down in an informal outline form -- it is not necessary at this point to use pseudo-code. 3) Refine the Plan and Translate into Pseudo-Code The plan devised in step 2) needs to be translated into pseudo-code. This refinement may be trivial or it may take several "passes". 4) Test the Design Using appropriate test data, test the algorithm by going through it step by step.
    [Show full text]
  • IDE-JASMIN an Interactive Graphical Approach for Parallel Programming in Scientific Computing
    IDE-JASMIN An Interactive Graphical Approach for Parallel Programming in Scientific Computing Liao Li, Zhang Aiqing, Yang Zhang, Wang Wei and Jing Cuiping Institute of Applied Physics and Computational Mathematics, No. 2, East Fenghao Road, Beijing, China Keywords: Parallel Programming, Integrator Component, Integrated Development Environment, Structured Flow Chart. Abstract: A major challenge in scientific computing lays in the rapid design and implementation of parallel applications for complex simulations. In this paper, we develop an interactive graphical system to address this challenge. Our system is based on JASMIN infrastructure and outstands three key features. First, to facilitate the organization of parallel data communication and computation, we encapsulate JASMIN integrator component models as user-configurable components. Second, to support the top-down design of the application, we develop a structured-flow-chart based visual programming approach. Third, to finally generate application code, we develop a powerful code generation engine, which can generate major part of the application code using information in flow charts and component configurations. We also utilize the FORTRAN 90 standard to assist users write numerical kernels. These approaches are integrated and implemented in IDE-JASMIN to ease parallel programming for domain experts. Real applications demonstrate that our approaches for developing complex numerical applications are both practical and efficient. 1 INTRODUCTION data access and manipulation, respectively. Using JASMIN, users need implement several subclasses “J Adaptive Structured Meshes applications of strategy classes in C++ language though they Infrastructure” (JASMIN) is an infrastructure for mainly focus on writing numerical subroutine in structured mesh and SAMR applications for FORTRAN. numerical simulations of complex systems on The limited popularization of JASMIN is parallel computers (Mo et al., 2010).
    [Show full text]
  • Introduction to Computer Science CSCI 109
    Introduction to Computer Science CSCI 109 China – Tianhe-2 Readings Andrew Goodney Fall 2019 St. Amant, Ch. 5 Lecture 7: Compilers and Programming 10/14, 2019 Reminders u Quiz 3 today – at the end u Midterm 10/28 u HW #2 due tomorrow u HW #3 not out until next week 1 Where are we? 2 Side Note u Two things funny/note worthy about this cartoon u #1 is COBOL (we’ll talk about that later) u #2 is ?? 3 “Y2k Bug” u Y2K bug?? u In the 1970’s-1980’s how to store a date? u Use MM/DD/YY v More efficient – every byte counts (especially then) u What is/was the issue? u What was the assumption here? v “No way my COBOL program will still be in use 25+ years from now” u Wrong! 4 Agenda u What is a program u Brief History of High-Level Languages u Very Brief Introduction to Compilers u ”Robot Example” u Quiz 6 What is a Program? u A set of instructions expressed in a language the computer can understand (and therefore execute) u Algorithm: abstract (usually expressed ‘loosely’ e.g., in english or a kind of programming pidgin) u Program: concrete (expressed in a computer language with precise syntax) v Why does it need to be precise? 8 Programming in Machine Language is Hard u CPU performs fetch-decode-execute cycle millions of time a second u Each time, one instruction is fetched, decoded and executed u Each instruction is very simple (e.g., move item from memory to register, add contents of two registers, etc.) u To write a sophisticated program as a sequence of these simple instructions is very difficult (impossible) for humans 9 Machine Language Example
    [Show full text]
  • Novice Programmer = (Sourcecode) (Pseudocode) Algorithm
    Journal of Computer Science Original Research Paper Novice Programmer = (Sourcecode) (Pseudocode) Algorithm 1Budi Yulianto, 2Harjanto Prabowo, 3Raymond Kosala and 4Manik Hapsara 1Computer Science Department, School of Computer Science, Bina Nusantara University, Jakarta, Indonesia 11480 2Management Department, BINUS Business School Undergraduate Program, Bina Nusantara University, Jakarta, Indonesia 11480 3Computer Science Department, Faculty of Computing and Media, Bina Nusantara University, Jakarta, Indonesia 11480 4Computer Science Department, BINUS Graduate Program - Doctor of Computer Science, Bina Nusantara University, Jakarta, Indonesia 11480 Article history Abstract: Difficulties in learning programming often hinder new students Received: 7-11-2017 as novice programmers. One of the difficulties is to transform algorithm in Revised: 14-01-2018 mind into syntactical solution (sourcecode). This study proposes an Accepted: 9-04-2018 application to help students in transform their algorithm (logic) into sourcecode. The proposed application can be used to write down students’ Corresponding Author: Budi Yulianto algorithm (logic) as block of pseudocode and then transform it into selected Computer Science Department, programming language sourcecode. Students can learn and modify the School of Computer Science, sourcecode and then try to execute it (learning by doing). Proposed Bina Nusantara University, application can improve 17% score and 14% passing rate of novice Jakarta, Indonesia 11480 programmers (new students) in learning programming. Email: [email protected] Keywords: Algorithm, Pseudocode, Novice Programmer, Programming Language Introduction students in some universities that are new to programming and have not mastered it. In addition, Programming language is a language used by some universities (especially in rural areas or with programmers to write commands (syntax and semantics) limited budget) do not have tools that can help their new that can be understood by a computer to create a students in learning programming (Yulianto et al ., 2016b).
    [Show full text]
  • Design and Implementation of Single Node Noc Router Using Small Side
    ISSN 2278-3091 Volume 9, No.4, July – August 2020 Priti ShahaneInternational, International Journal Journal of Advanced of TrendsAdvanced in Computer Trends Science and in Engineering,Computer 9(4), Science July – August and 2020, Engineering 5700 – 5709 Available Online at http://www.warse.org/IJATCSE/static/pdf/file/ijatcse222942020.pdf https://doi.org/10.30534/ijatcse/2020/2 22942020 Design and Implementation of Single Node NoC Router using Small Side Buffer in Input Block and iSLIP Scheduler Priti Shahane1 1Symbiosis Institute of Technology, Symbiosis International (Deemed University) Pune, India, [email protected] as slave devices. The standard bus based device has a ABSTRACT limitation of scalability and turns into a bottleneck in a complex system. Shared bus for example AMBA bus as well as Network on chip (NoC) has been recommended as an IBM’s core connects becomes overloaded fast when more emerging alternative for scalability and performance needs of number of master modules is connected to it. To overcome next generation System on chips (SoCs). NoCs are actually this problem, Network on chip (NoC) is suggested as a forecast to solve the bus based interconnection problem of SoC communication subsystem among various IP cores of a SoC. NoC has emerged as an effective and scalable communication where large numbers of Intellectual property modules (IPs) are centric approach to solving the interconnection problem for incorporated on a single chip for much better results. NoC such architecture [1]-[3]. The NoC structure consists of 4 provides a solution for communication infrastructure for SoC. major components specifically routers, link and network The router is a foremost element of NoC which significantly interface and IP modules.
    [Show full text]
  • Computer Graphics
    ANSI X3.124.2 1988 3 American National Standard ADOPTED FOR USE BY THE for information systems - FEDERAL GOVERNMENT WLrt? computer graphics - PUB 120-1 graphical kernel system (GKS) SEE NOTICE ON INSIDE pascal binding X3.124.2-1988 ANSI american nationalana standards institute, me 1430 broadway, new york, new york 10018 . A8A3 NO.120-1 1988 This standard has been adopted for Federal Government use. Details concerning its use within the Federal Government are contained in Federal Information Processing Standards Publication 120-1, Graphical Kernel System (GKS). For a complete list of the publications available in the Federal Information Processing Standards Series, write to the Standards Processing Coordinator (ADP), National Institute of Standards and Technology, Gaithersburg, MD 20899. ANSI® X3.124.2-1988 American National Standard for information Systems - Computer Graphics - Graphical Kernel System (GKS) Pascal Binding Secretariat Computer and Business Equipment Manufacturers Association Approved February 18, 1988 American National Standards Institute, Inc Approval of an American National Standard requires verification by ANSI that the re¬ American quirements for due process, consensus, and other criteria for approval have been met by National the standards developer. Consensus is established when, in the judgment of the ANSI Board of Standards Review, Standard substantial agreement has been reached by directly and materially affected interests. Sub¬ stantial agreement means much more than a simple majority, but not necessarily unanim¬ ity. Consensus requires that all views and objections be considered, and that a concerted effort be made toward their resolution. The use of American National Standards is completely voluntary; their existence does not in any respect preclude anyone, whether he has approved the standards or not, from man¬ ufacturing, marketing, purchasing, or using products, processes, or procedures not con¬ forming to the standards.
    [Show full text]
  • Lab Manual for Is Lab
    WCTM /IT/LAB MANUAL/6TH SEM/IF LAB LAB MANUAL FOR IS LAB 1 INTELLIGENT SYSTEM LAB MANUAL WCTM /IT/LAB MANUAL/6TH SEM/IF LAB STUDY OF PROLOG Prolog – Programming in Logic PROLOG stands for Programming In Logic – an idea that emerged in the early 1970s to use logic as programming language. The early developers of this idea included Robert Kowalski at Edinburgh ( on the theoretical side ), Marrten van Emden at Edinburgh (experimental demonstration ) and Alain Colmerauer at Marseilles ( implementation). David D.H.Warren’s efficient implementation at Edinburgh in the mid – 1970’s greatly contributed to the popularity of PROLOG. PROLOG is a programming language centered around a small set of basic mechanisms, including pattern matching , tree-based data structuring and automatic backtracking. This small set constitutes a surprisingly powerful and flexible programming framework. PROLOG is especially well suited for problems that involve objects – in particular, structured objects – and relations between them . SYMBOLIC LANGUAGE PROLOG is a programming language for symbolic , non – numeric computation. It is especially well suited for solving problems that involve objects and relations between objects . For example , it is an easy exercise in prolog to express spatial relationship between objects , such as the blue sphere is behind the green one . It is also easy to state a more general rule : if object X is closer to the observer than object Y , and Y is closer than Z, then X must be closer than Z. PROLOG can reason about the spatial relationships and their consistency with respect to the general rule . Features like this make PROLOG a powerful language for Artificial Language (A1) and non – numerical programming.
    [Show full text]