Preview

Introductions to Prolog

Good Essays
Open Document
Open Document
2151 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Introductions to Prolog
Principles of Programming Languages, 3
Matteo Pradella
DEI, PoliMi

May 2012

Matteo Pradella (DEI, PoliMi)

Principles of Programming Languages, 3

May 2012

1 / 54

1

Logic Programming: Prolog

2

Managing nondeterminism

3

The Prolog Language

Matteo Pradella (DEI, PoliMi)

Principles of Programming Languages, 3

May 2012

2 / 54

Introduction to Prolog

Created around 1972 by Alain Colmerauer with Philippe Roussel, based on Robert Kowalski’s procedural interpretation of Horn clauses. decidable subset: Datalog, a query and rule language for deductive databases its failure as a mainstream language traditionally due to the following: Prolog usage in Fifth Generation Computer Systems project (FGCS) FCGS was an initiative by Japan’s Ministry of International Trade and Industry, begun in 1982, to create a "fifth generation computer"

Matteo Pradella (DEI, PoliMi)

Principles of Programming Languages, 3

May 2012

2 / 54

Prolog in the real world
Prolog is not used much nowadays still, for some activities it can be very useful - probably it was just a bad idea to use it as a system programming language. There are implementations usable for parts of the logic of complex applications e.g. written in Java first of all: rapid prototyping. E.g. Prolog was used at Ericsson for implementing the first Erlang interpreter other usages: some academic intrusion detection systems; event handling middlewares; some Nokia phones with the defunct MeeGoo (namely N900, N950, and N9): the policy engine’s rules switching part is written in Prolog and drives an important part of the handsets’ functionality

Matteo Pradella (DEI, PoliMi)

Principles of Programming Languages, 3

May 2012

3 / 54

Prolog and logic: Horn clauses

in general, a logic program has the following form: ∀X1 . . . Xm i i i i φ i ⇐ θ1 ∧ θ2 ∧ . . . ∧ θn

note that φ ⇐ (θ1 ∨ θ2 ) ∧ θ3 is equivalent to (φ ⇐ θ ∧ θ3 ) ∧ (θ ⇐ θ1 ) ∧ (θ ⇐ θ2 ) we start from a

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Prolog was invented in 1972 by roussel Kowalski and colmerauer was the first logic programming language. Was meant for general programming branching with AI and computer linguistics…

    • 388 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Match the correct vocabulary term to each numbered statement. Write the letter of the correct term on the line.…

    • 2641 Words
    • 14 Pages
    Satisfactory Essays
  • Good Essays

    eci 114

    • 754 Words
    • 7 Pages

    Find a proposition with three variables p, q, and r that is true when exactly one of…

    • 754 Words
    • 7 Pages
    Good Essays
  • Satisfactory Essays

    Design a modular program that asks the user to enter a distance in kilometers, and the converts that distance to miles. The conversion formula is as follows:…

    • 620 Words
    • 5 Pages
    Satisfactory Essays
  • Good Essays

    Pragmatic and procedural reasoning are two type strategies used by occupational therapy practitioners in clinical reasoning. Pragmatic reasoning focuses on the factors in the context of the practice and the client personal context that might affect the intervention, whereas procedural reasoning focuses on the client goals, and treatment plan that can help improve the client functional performance. Some examples of pragmatic reasoning are skills, equipment, time, law and policies. After the evaluation of the client, the therapist developed a treatment plan based the client needs. The treatment plan included the time and the equipment required for each activity. The therapist also followed the law and the policies established by the facility.…

    • 265 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    Kurt Godel successfully demonstrated how these standards are in fact paradoxical. At the core of mathematics there is a logical system of rules that enable us to count. Can this logical system be used to prove that it is itself without contradiction? Godel's answer was yes but only if the logical system is in fact contradictory. It seems then that a logical system is always in a catch 22. If a system can prove its own consistency then it has in fact proved the opposite. In other words a logical system cannot be both consistent and complete. Godel's incompleteness theorem revealed two things: 1) Not all mathematical truths are axiomatically grounded. 2) No consistent mathematical system can prove its own consistency and is thus incomplete. Godel's…

    • 217 Words
    • 1 Page
    Satisfactory Essays
  • Best Essays

    B1 Exam Paper

    • 1453 Words
    • 6 Pages

    (i) Complete the sentence by putting a cross ( ) in the box next to your answer.…

    • 1453 Words
    • 6 Pages
    Best Essays
  • Good Essays

    Logical Design Pt. 2

    • 641 Words
    • 3 Pages

    Hello sirs, my name is , it has come to my attention that there are some misconceptions about the value in normalizing your database. I wanted to write this correspondence to address any concerns that you may have about flexibility while entering your data into the system. This letter is to assure you and the other members of your executive board that you will have some flexibility within your E-R Model.…

    • 641 Words
    • 3 Pages
    Good Essays
  • Better Essays

    X + C → XC Y + XC → XYC XYC → CZ CZ → C + Z…

    • 2251 Words
    • 10 Pages
    Better Essays
  • Best Essays

    Miss

    • 1290 Words
    • 6 Pages

    Complete the sentence by putting a cross ( ) in the box next to your answer.…

    • 1290 Words
    • 6 Pages
    Best Essays
  • Powerful Essays

    Logic Study Guide

    • 1307 Words
    • 6 Pages

    This quiz consist of 20 multiple choice questions and covers the material in the second half of Chapter 9. Be sure you are in Chapter 9 when you take the quiz.…

    • 1307 Words
    • 6 Pages
    Powerful Essays
  • Good Essays

    Then comes a number, the number three and given that at the end of the…

    • 660 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    During an informational symposium in 1956 Allen Newell and Herbert Simon presented papers on computers logic.. Noam Chomsky presented views on language as an inherited rule governed system; Miller described his research demonstrating that people can discriminate only seven different aspects of something.…

    • 297 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Nowadays, many rap and hip-hop songs have evolved, or rather devolved, to simple beats with lyrics that encourage violence and drug use and lack a true meaning. Logic, on the other hand, is ?distinguished by [his] confidence, passion, versatility, raw lyricism, intellect, and a Frank Sinatra-like swagger? [footnoteRef:1]. Logic?s identity is evident through not only his lyrics, but also the musical composition of his songs. His style mimics the old school style of rap, and has drawn the praise of many in the hip-hop community, including stars such as Lupe Fiasco and Nas. In all, Logic's unique use of rhythm and timbre throughout his mix tape "Young Sinatra Undeniable" reveals his thoughts,…

    • 1203 Words
    • 5 Pages
    Powerful Essays
  • Good Essays

    High-stakes tests or high-stakes appraisals have turned out to be a piece of the training vernacular since the entry of the No Child Left Behind Act (Cohen , 2007). These evaluations have vital choices or outcomes riding on the outcome. In training, these choices regularly identify with government and neighborhood subsidizing, position and graduation choices or continuous residency for educators. It's to some degree telling that low-stakes testing is the way we allude to appraisals used to really decide the scholastic advancement of the understudy.…

    • 548 Words
    • 3 Pages
    Good Essays