Google Answers Logo
View Question
 
Q: Definition of computer terms: Rule-based Programming and Procedural Programming ( Answered 5 out of 5 stars,   2 Comments )
Question  
Subject: Definition of computer terms: Rule-based Programming and Procedural Programming
Category: Computers > Programming
Asked by: intelli-ga
List Price: $20.00
Posted: 12 Apr 2004 17:10 PDT
Expires: 12 May 2004 17:10 PDT
Question ID: 329201
I'm looking for a quotable definition from a reputable source
(dictionaries, encyclopedias, college courses and textbooks) of
the following computer terms: "Rule-based Programming" and "Procedural
Programming". Thank you.

Request for Question Clarification by aht-ga on 12 Apr 2004 17:56 PDT
intelli-ga:

Can you advise if this is what you mean by rules-based programming:

http://www.program-transformation.org/Transform/WorkshopOnRuleBasedProgramming

and that this is what you mean by procedural programming?

://www.google.com/search?q=define:Procedural+programming

Regards,

aht-ga
Google Answers Researcher
Answer  
Subject: Re: Definition of computer terms: Rule-based Programming and Procedural Programming
Answered By: aht-ga on 12 Apr 2004 18:38 PDT
Rated:5 out of 5 stars
 
intelli-ga:

Thank you for your Question requesting quotable definitions, from a
reputable source, for the following two computer programming terms:
"Rules Based Programming" and "Procedural Programming". I have found
the following that should help with this.


Rule-based Programming:
=======================

Rules-based programming is part of the curriculum for a course taught
by Professor John M Browne, of the School of Engineering and Science,
Swinburne University of Technology, in Melbourne, Australia. Prof.
Browne maintains an online version of his course notes, located at:

http://www.ses.swin.edu.au/homes/browne/programmingforengineers/coursenotes/index.htm

Please note the copyright notice on this webpage, and the contact
information at the bottom of the page for Prof. Browne so that you may
obtain his permission to make substantial use of his material should
you be incorporating it into another work.

Prof. Browne covers rule-based programming in Chapter 7 of his course notes:

---------------------------------

"A rule-based program consists of a collection of function definitions
for the same function, each definition valid for arguments of a given
pattern only.

Note carefully that the word "rule" in rule-based programming refers
to a function definition, not specifically to rules of the sort that
use  and . The reason is, as we will see more fully later, that
function definitions are just another example of rewrite rules, just
like those using -> and :->. In line with common usage, we will from
now on, often refer to a function definition as a rule.

Rule-based programs can be an easy way to program because you just
write a collection of rules to be used in different circumstances, and
leave it up to the software to make the decision as to which one to
use in any given circumstance.

In the past, it was just this sort of decision making process which
older program languages
required you to do, which led to what was called "spaghetti"
programming, where it was very
difficult to trace the logic (strand of spaghetti) for debugging and
quality assurance."

- http://www.ses.swin.edu.au/homes/browne/programmingforengineers/coursenotes/notespdf/7RuleBasedProgramming.pdf

Reference:

Browne, J M. "Programming For Engineers with Mathematica: Course
Notes". Chapter 7. Swinburne University of Technology, Melbourne,
Australia. (c) 2001.

---------------------------------



Another definition of rule-based programming can be found at WebReference.com:

---------------------------------

"Imagine a different way to program in which you specify rules and
facts instead of the usual linear set of instructions. That's the idea
behind rule-based programming. A rule engine automatically decides how
to apply the rules to your facts, and hands you the result. Rule-based
systems are growing in popularity. Rule engines are ubiquitous in the
enterprise, and rule-based systems control everything from web sites
to control factories."

- http://www.webreference.com/programming/rule/

---------------------------------



Procedural Programming:
=======================

As I indicated in my request for clarification above, several
definitions for procedural programming can be found online through the
Google 'define:' search:

://www.google.com/search?q=define:Procedural+programming

---------------------------------

"Simplest programming paradigm, useful to bring order in the maze of
algorithms available to solve a particular problem numerically.
Supported by all modern programming languages by facilities for
passing arguments to and returning values from functions. Elementary
condition of programming rather than a method of choice."

- http://www.cs.uwa.edu.au/programming/c++.tutorial/glossary/



"Where the program starts at the first line of code and follows a
defined path, calling procedures as needed. Most ASP is procedeural,
calling functions and subroutines. Similarly, HTML is procedural in
this manner. JavaScript, on the other hand, (to include Javascript
that enhances HTML -- that makes HTML into "DHTML") is often
event-driven. The code resides there until an event takes place."

- http://www.glasmenagerie.net/Tim/Lessons/glossary.htm



"Programming paradigm characterized by the use large sections of
linear code. Very little structure is evident in the code itself. Flow
charts are usually required to understand the program logic."

- http://lesh.net/scccc/CPT285/glossary.html



---------------------------------


I hope that these definitions help! Please let me know, using the
Request Clarification button above, if you need me to expand on any
part of this Answer; as you have asked for quotable definitions, I
have tried to be brief and to the point.

Regards,

aht-ga
Google Answers Researcher

Request for Answer Clarification by intelli-ga on 13 Apr 2004 07:59 PDT
Unfortunately this is not "good enough". I need a better and more
precise definition. Please do more searches on "rule based"
(rules-based, rule-based) programming paradigm and procedural
programming paradigm.

Clarification of Answer by aht-ga on 13 Apr 2004 13:46 PDT
Additional definitions, that you will hopefully find more precise:

-----------------------------

From Wikipedia, as suggested by stephenvakil-ga in the comments section, we have:

"Rule-based languages instantiate rules when activated by conditions
in a set of data. Of all possible activations, some set will be
selected and the statements belonging to those rules will be
executed."

- http://en.wikipedia.org/wiki/Categorical_list_of_programming_languages


"Procedural languages are based upon the concept of the unit and scope
(the data viewing range of an executable code statement). A procedural
program is composed of one or more units or modules--either user coded
or provided in a code library; each module is composed of one or more
procedures, also called a function, routine, subroutine, or method,
depending on the programming language."

- http://en.wikipedia.org/wiki/Categorical_list_of_programming_languages

=============================


Other definitions include:

Rule-based programming:
=======================

-----------------------------



"The rule-based system itself uses a simple technique: It starts with
a rule-base, which contains all of the appropriate knowledge encoded
into If-Then rules, and a working memory, which may or may not
initially contain any data, assertions or initially known information.
The system examines all the rule conditions (IF) and determines a
subset, the conflict set, of the rules whose conditions are satisfied
based on the working memory. Of this conflict set, one of those rules
is triggered (fired). Which one is chosen is based on a conflict
resolution strategy. When the rule is fired, any actions specified in
its THEN clause are carried out. These actions can modify the working
memory, the rule-base itself, or do just about anything else the
system programmer decides to include. This loop of firing rules and
performing actions continues until one of two conditions are met:
there are no more rules whose conditions are satisfied or a rule is
fired whose action specifies the program should terminate."

- http://ai-depot.com/Tutorial/RuleBased.html

-----------------------------

"Rule-Based Systems

Instead of representing knowledge in a relatively declarative, static
way (as a bunch of things that are true), rule-based system represent
knowledge in terms of a bunch of rules that tell you what you should
do or what you could conclude in different situations. A rule-based
system consists of a bunch of IF-THEN rules, a bunch of facts, and
some interpreter controlling the application of the rules, given the
facts."

- http://www.cee.hw.ac.uk/~alison/ai3notes/section2_4_4.html

-----------------------------

"Rule-based systems differ from standard procedural or object-oriented
programs in that there is no clear order in which code executes.
Instead, the knowledge of the expert is captured in a set of rules,
each of which encodes a small piece of the expert's knowledge. Each
rule has a left hand side and a ride hand side. The left hand side
contains information about certain facts and objects which must be
true in order for the rule to potentially fire (that is, execute). Any
rules whose left hand sides match in this manner at a given time are
placed on an agenda. One of the rules on the agenda is picked (there
is no way of predicting which one), and its right hand side is
executed, and then it is removed from the agenda. The agenda is then
updated (generally using a special algorithm called the Rete
algorithm), and a new rules is picked to execute. This continues until
there are no more rules on the agenda."

- http://www.ramalila.net/Adventures/AI/rule_based_systems.html

-----------------------------

"Rule-based programming is one of the most commonly used techniques
for developing expert systems. In this programming paradigm, rules are
used to represent heuristics, or "rules of thumb," which specify a set
of actions to be performed for a given situation. A rule is composed
of an if portion and a then portion. The if portion of a rule is a
series of patterns which specify the facts (or data) which cause the
rule to be applicable. The process of matching facts to patterns is
called pattern matching. The expert system tool provides a mechanism,
called the inference engine, which automatically matches facts against
patterns and determines which rules are applicable. The if portion of
a rule can actually be thought of as the whenever portion of a rule
since pattern matching always occurs whenever changes are made to
facts. The then portion of a rule is the set of actions to be executed
when the rule is applicable. The actions of applicable rules are
executed when the inference engine is instructed to begin execution.
The inference engine selects a rule and then the actions of the
selected rule are executed (which may affect the list of applicable
rules by adding or removing facts). The inference engine then selects
another rule and executes its actions. This process continues until no
applicable rules remain."

- http://www.ghg.net/clips/WhatIsCLIPS.html

=============================


Procedural Programming:
=======================

-----------------------------

"Procedural programming is a method (a programming paradigm) of
computer programming based upon the concept of the unit and scope (the
data viewing range of an executable code statement). A procedural
program is composed of one or more units or modules--either user coded
or provided in a code library ; each module is composed of one or more
procedures, also called a function, routine, subroutine, or method,
depending on programming language. It is possible for a procedural
program to have multiple levels or scopes, with procedures defined
inside other procedures. Each scope can contain variables which cannot
be seen in outer scopes.

Procedural programming offers many benefits over simple sequential
programming: Procedural programming code is easier to read and more
maintainable; Procedural code is more flexible; Procedural programming
allows for the easier practice of good program design."

- http://encyclopedia.thefreedictionary.com/Procedural%20programming

-----------------------------

"procedural programming

Programming in which programs are written as lists of instructions for
the computer to obey in sequence. It closely matches the computer's
own sequential operation."

- http://www.tiscali.co.uk/reference/dictionaries/computers/data/m0044551.html

-----------------------------

"Declarative vs Procedural Programming

Procedural programming requires that the programmer tell the computer
what to do. That is, _how_ to get the output for the range of required
inputs. The programmer must know an appropriate algorithm."

- http://education.leeds.ac.uk/~paul/prologbook/node11.html 

-----------------------------

"A procedural program is written as a list of instructions, telling
the computer, step-by-step, what to do: Open a file, read a number,
multiply by 4, display something. Program units include the main or
program block, subroutines, functions, procedures; file scoping;
includes/modules; libraries."

- http://www.colorado.edu/its/scico/Info/details/funcproc.html

-----------------------------

(for interest only: not a typical online reference source)

"Procedural Programming Analogy

I have always found it somewhat difficult to really describe to
non-programming people the difference between object-oriented and
procedural programming. Specifically, I never thought of a clear way
to explain the disadvantage of procedural code. In An Introduction to
Programming and Object Oriented Design Using Java by Jaime Niņo, they
use the analogy of a Rube Goldberg device. Each component is very
dependent on the next, and replacing one with something else without
altering the other components is nearly impossible. And that's
basically the major disadvantage to procedural programming. It's more
difficult to alter a piece of code without needing to rewrite other
parts."

- http://fallenearth.org/blogs/caiuschen/archives/2003/09/30/procedural_programming_analogy/index.php

=============================

Do these help you more? Perhaps if you can clarify for me who the
intended audience is, I can try to refine the results to match. For
fundamental terminology such as this, it is surprising how few good
definitions exist online, it is almost as if the website authors just
assume that "everybody knows what these mean". It would almost be
easier for me to write my own definitions for you, but I respect your
request that the sources be from online sources, textbooks, or
academic sources.

Regards,

aht-ga
Google Answers Researcher
intelli-ga rated this answer:5 out of 5 stars
Thank you very much.

Comments  
Subject: Re: Definition of computer terms: Rule-based Programming and Procedural Programming
From: stephenvakil-ga on 13 Apr 2004 08:45 PDT
 
Wikipedia has pretty accurate definitions.
Subject: Re: Definition of computer terms: Rule-based Programming and Procedural Programming
From: intelli-ga on 13 Apr 2004 10:26 PDT
 
Good. And I would appreciate if a Google researcher can compile an answer for me.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy