DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > Day 3 - Prolog

Day 3 - Prolog

Wayne Adams user avatar by
Wayne Adams
·
Apr. 01, 11 · Java Zone · Interview
Like (0)
Save
Tweet
5.28K Views

Join the DZone community and get the full member experience.

Join For Free

Prolog is the 3rd language covered in Bruce Tate's Seven Languages in Seven Weeks, and is a declarative, rather than imperative, language. Prolog is not new, of course (1972), but I have to admit this is the first time I've taken a look at it.

Like Bruce, I used GNU Prolog (1.3.1). As he describes the language, the building blocks are facts and rules (which together form a knowledge base), and queries. He describes some simple queries, then moves on to substituting variables in queries. He finishes the first day of the Prolog segment with a discussion of Prolog unification, then an interview with Brian Tarbox, a dolphin researcher who used Prolog both to simulate dolphin behavior and to schedule the personnel needed for each dolphin experiment. According to Tarbox, Prolog was very well suited for solving both types of problems.

The first day looked at declaring facts and rules and making simple queries against them. Day 2 adds some more tools, including recursion, math functions, and lists and tuples (and operations on them). Day 2 is the day where my experiment in covering one language per day seems the least feasible; I'm not familiar with declarative (programming) languages and although I get the idea, a lot of it went over my head. Bruce is extremely profuse with examples, deconstructed ones at that. If I wanted to learn Prolog, I would start with this book first and spend a few more days on it.

For Day 3, Bruce goes through two detailed examples -- a solution for a small Sudoku puzzle, and the Eight Queens problem. He then finishes with a discussion of Prolog's strengths and weaknesses, including listing problem spaces for which Prolog is particularly well-suited. Those areas? Scheduling constrained resources, natural-language processing, games, semantic web representation and artificial intelligence. 

From http://wayne-adams.blogspot.com/2011/03/day-3-prolog.html

Prolog

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • After COVID, Developers Really Are the New Kingmakers
  • Upsert in SQL: What Is an Upsert, and When Should You Use One?
  • Top 20 Git Commands With Examples
  • Making Your SSR Sites 42x Faster With Redis Cache

Comments

Java Partner Resources

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo