You are on page 1of 1

Top of Form

Further Links
Bottom of Form

Syllabus | Exams | Assessment | Resources | Site reviews | Careers

Software Design and Development


Home > Software Design and Development > Options > Evolution of Programming Languages > Programming Paradigms

Logic Paradigm
The logic paradigm is about having a program which specifies what the problem is, not how to solve it. Logic programming languages such as PROLOG and expert systems consist of knowledge (facts) and other properties about the problem (rules). A classic PROLOG problem, the family database, illustrates succinctly the building blocks of the logic paradigm. Facts that are defined are the persons gender (male or female) and any parent relationships. Once those facts are known rules can be written which generate further facts. These rules are relationships which depend upon the defined facts e.g. grandparent, grandmother, grandfather, sibling, brother and sister. Logic programs are goal driven. The focus is on the goal to be achieved rather than the steps required to be performed. Control is not a concern of the programmer. Logic programs use recursion to perform their tasks rather than the repetition control structure. The user can ask a question of a logic program by giving it a goal to prove. The program will try and confirm the goal by using the facts and rules. If the program is unable to confirm the goal using the available facts and rules then it assumes that the goal is false. Logic programs attempt to prove the goal by using either forward or backward chaining. Forward chaining uses the rules to generate more facts, whether or not they will be needed to prove the goal. Backward chaining starts with the goal and attempts to prove all necessary rules and facts. Backward chaining is more efficient as it does not generate unnecessary facts.

You might also like