Prolog for noobs

118 views
Skip to first unread message

Paul Brown

unread,
Aug 5, 2018, 7:23:57 AM8/5/18
to SWI-Prolog
Reading this month's issue of MagPi, "AI Made Easy", got me thinking about creating a bank of resources for complete beginners, possibly children.  These should be the kind of thing that can be completed in an hour or two, adapted or tweaked, and introduce different domains that Prolog excels in, such as Expert Systems, DCGs, CLP, etc. They could then be submitted to MagPi for publication or Raspberry Pi Foundation as tutorials, perhaps have a spot on swi-prolog.org, and perhaps be a foundation for some YouTube videos.

I'm happy to write copy, write code, test, organise etc. But I've only been programming in Prolog for less than a year, albeit almost full-time for the past couple of months. This means I haven't had much exposure to the joys of Prolog outside my field, which is ontology informed planning. So I was hoping other members of this community would also be excited about this idea and perhaps contribute, particularly with ideas for projects that are suitable. Think, "what would a 13 year old Prologer want to make?" and dial it back to something they can achieve too! Or what fun things have you made/wish you'd made that might be appropriate?  So far all I've come up with is a dinosaur identifying expert system.

Is this a project you'd like to be involved in? Got any ideas?

Paulo Moura

unread,
Aug 5, 2018, 12:16:35 PM8/5/18
to Paul Brown, SWI-Prolog
Hi Paul

> On 5 Aug 2018, at 12:23, Paul Brown <pbrow...@gmail.com> wrote:
>
> Reading this month's issue of MagPi, "AI Made Easy", got me thinking about creating a bank of resources for complete beginners, possibly children. These should be the kind of thing that can be completed in an hour or two, adapted or tweaked, and introduce different domains that Prolog excels in, such as Expert Systems, DCGs, CLP, etc. They could then be submitted to MagPi for publication or Raspberry Pi Foundation as tutorials, perhaps have a spot on swi-prolog.org, and perhaps be a foundation for some YouTube videos.
>
> I'm happy to write copy, write code, test, organise etc. But I've only been programming in Prolog for less than a year, albeit almost full-time for the past couple of months. This means I haven't had much exposure to the joys of Prolog outside my field, which is ontology informed planning. So I was hoping other members of this community would also be excited about this idea and perhaps contribute, particularly with ideas for projects that are suitable. Think, "what would a 13 year old Prologer want to make?" and dial it back to something they can achieve too! Or what fun things have you made/wish you'd made that might be appropriate? So far all I've come up with is a dinosaur identifying expert system.

Nice initiative :-)

> Is this a project you'd like to be involved in? Got any ideas?

Text adventures are easy to write in Prolog and can also be a fun project. For youngsters, maybe start from a simple one (instead of from scratch) and have them expanding it.

Cheers,
Paulo

Peter Ludemann

unread,
Aug 5, 2018, 12:25:51 PM8/5/18
to Paulo Moura, Paul Brown, SWI-Prolog
It's been done (although I have some quibbles with the Prolog style):

 

Cheers,
Paulo

--
You received this message because you are subscribed to the Google Groups "SWI-Prolog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/swi-prolog.
For more options, visit https://groups.google.com/d/optout.

Boris Vassilev

unread,
Aug 5, 2018, 12:35:12 PM8/5/18
to Peter Ludemann, SWI-Prolog
It is one of the largest textbooks available freely online*.

Basically, it seems to be written for a Prolog that does not have garbage collection :-)

* The others I know are  "Learn Prolog Now!", not too exciting in its contents and has some omissions. Then there is "The Power of Prolog" by Markus Triska and this is not for the average 13-year old.

Save our in-boxes! http://emailcharter.org

Anne Ogborn

unread,
Aug 5, 2018, 3:55:33 PM8/5/18
to Paul Brown, SWI-Prolog
I'd love to be involved in this.

I've got a ragtag collection of prolog examples, not well curated.

Expert systems and text adventures are fun, and I frequently run into beginning prolog programmers wanting to fiddle with the Amzi system.

Story generation could be fun. I have a story generator you can have.
My Intro to SWI-Prolog class is using this as a class project. I'm going to have a huge variety of these as soon as students turn them in. I'm sure most would be OK with letting you use them.
The project was deliberately rather open ended, and there's lots of variation - one even plays the game "Mille Bournes".

I have a few programs that solve boat and river problems of the farmer/goat/wolf/cabbage variety.

Story:
I was once asked by a college prof to be a video guest speaker for her class. Sure. No more info.
I arrive the day of, and discover this is a cognitive sci class, and the students, who had no other
programming experience, are going to demonstrate their class projects, which were changing the Amzi/Merritt
expert system tutorials to do other things.

Jon Nichol did a study in which he and Jonathan Briggs taught middle school students Prolog, not as a programming course, but as a way of teaching them to reason. So assignments were to demonstrate logical inferences about subjects like history.

Paul Brown

unread,
Aug 6, 2018, 5:50:22 AM8/6/18
to SWI-Prolog
Thanks everyone. It's good to see some interest in getting new people interested! I'll take a look at Amzi for inspiration,  story generators, expert systems, and the boat-river problems will be a great start. The aim isn't to create yet another Prolog textbook, or course, or curriculum. It's just a bunch of fun things to do with Prolog that'll be good for capturing interest, testing skills while learning, and inspiring people to make their own projects. It's more of an evangelism platform than an instructional guide.

I'll be looking at contributing about 3 hours a week to this initially, I've created a repository to be a home/base for it at: https://gitlab.com/PaulBrownMagic/PPFN
I've not run a free-software kind of project before, so I'm open to advice! There's not much in the repository right now, I've GPL licensed it to ensure it stays free
and written a draft contributing guide. I won't be adding any draft projects until the end of the week.

Torbjörn Lager

unread,
Aug 7, 2018, 5:20:14 AM8/7/18
to pbrow...@gmail.com, SWI-Prolog
Perhaps a haiku poetry generator would be fun in this context? See

https://swish.swi-prolog.org/p/playing_with_wordnet.swinb

Feel free to use it any way you want.

Cheers,
Torbjörn
> --
> You received this message because you are subscribed to the Google Groups "SWI-Prolog" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+...@googlegroups.com.
> Visit this group at https://groups.google.com/group/swi-prolog.
> For more options, visit https://groups.google.com/d/optout.



--
Torbjörn Lager
Professor of General and Computational Linguistics
Department of Philosophy, Linguistics and Theory of Science
University of Gothenburg
Box 200, SE-405 30 Gothenburg, Sweden
Phone: +46317864962

A. linden

unread,
Aug 8, 2018, 4:50:37 PM8/8/18
to swi-p...@googlegroups.com


    Would web-based language learning fit in your project? Ten years ago, as a language teacher with some training in Prolog, I was asked to find means of teaching French to foreign adults in my native, multi-lingual country, Switzerland. I drafted an application in BinProlog (Tarau et al.) based on Caleb Gattegno's interactive approach to language learning, called Words in Color and The Silent Way. For those who are unfamiliar with his approach, it is based on the following assumptions:

    Gattegno (1911-1988), a mathematician and philosopher, thought that words and sentences could be formed using a combination of colors, signs and sounds, without any explicit reference to traditional grammar. He had the intuition of his system while observing native learners of amharic during a scientific mission to Aethiopia in  the 1950's. He developed a model which he called Words in Color, aiming at absolute beginners, i.e., children and adults with little or no school background. He used the same approach for learners of a second language, which he called The Silent Way.

    Later in his life, he began implementing his model computationally, until death interrupted his work. That initial version had neither sound nor color. A more recent version has been developed in the meantime by the main distributor of Gattegno's works in Europe, the Une Education pour Demain association in France. This version now includes sound and color.  

    Wouldn't the distance learning means now available on the web, in particular in the fields of voice recognition and synthesis, natural language processing and network interconnection make it possible to give a new life to Words in Color and The Silent Way? Systems similar to tele-conferencing and chat, or derived from MOOs (Multiple Users Domain-Object Oriented) are increasingly used in mediated language learning, sharing many of their properties with The Silent Way. No doubt, Gattegno would have found Prolog and the semantic web an ideal context in which to build his model.

    However, to my knowledge none of the existing systems, as graphically developed as they may be, can be fully controlled with commands in natural language. I therefore implemented as a personal project an application aiming at integrating the entire Silent Way in Prolog, using BinProlog's derivative of MOOs, Logimoo. Unfortunately, as Mr. Tarau just informed me, Logimoo is no longer developed. He suggested that I port my code to SWI-Prolog instead.

    I would be happy to provide the code I still have but I am afraid I would have to start almost from scratch in order to obtain a new, working application. Should any participant nonetheless be interested in pursuing the adventure of exploring Gattegno's approach in a modern, web-based environment, I am sending, attached herewith, the final report I wrote for my project, which I submitted in 2007 at the Faculty of Computer Science and Communication of the Swiss Federal Institute of Technology in Lausanne.

    Although my report is in French (as I unfortunately don't have an English version), I will be happy to provide an abstract of it in English for those who might be interested in giving a second life to Gattegno's work.

   As Paul Tarau says (I quote him):

   Gattegno's learning model looks very interesting and definitely worth exploring in a modern, Web-based environment.

    Thank you for your interest.


    André Linden



 



Le 05. 08. 18 à 13:23, Paul Brown a écrit :
Reading this month's issue of MagPi, "AI Made Easy", got me thinking about creating a bank of resources for complete beginners, possibly children.  These should be the kind of thing that can be completed in an hour or two, adapted or tweaked, and introduce different domains that Prolog excels in, such as Expert Systems, DCGs, CLP, etc. They could then be submitted to MagPi for publication or Raspberry Pi Foundation as tutorials, perhaps have a spot on swi-prolog.org, and perhaps be a foundation for some YouTube videos.

I'm happy to write copy, write code, test, organise etc. But I've only been programming in Prolog for less than a year, albeit almost full-time for the past couple of months. This means I haven't had much exposure to the joys of Prolog outside my field, which is ontology informed planning. So I was hoping other members of this community would also be excited about this idea and perhaps contribute, particularly with ideas for projects that are suitable. Think, "what would a 13 year old Prologer want to make?" and dial it back to something they can achieve too! Or what fun things have you made/wish you'd made that might be appropriate?  So far all I've come up with is a dinosaur identifying expert system.

Is this a project you'd like to be involved in? Got any ideas?
rapport final.pdf

Paul Brown

unread,
Aug 9, 2018, 6:31:37 AM8/9/18
to SWI-Prolog
Haiku generator looks great! I'll certainly have a play with it. This is the sort of project that will capture the interest of people and they can follow along in an afternoon, achieve something, feel proud, and start delving deeper into if they wish. Perfect for the hobbyist.

Web-based language learning sounds fascinating, and it sounds like a wonderful project. However, this "project" isn't really a "project" so much as a collection of simple projects a relative beginner, hobbyist, or learner might wish to do. Kind of like short assignments you would get on a course, except with all the answers!

Paul Brown

unread,
Aug 9, 2018, 10:42:49 AM8/9/18
to SWI-Prolog
Project number one is made and online, I think it'll help to see what kind of thing I'm getting at:


Not the most fun or useful project, but you get the idea!

Anne Ogborn

unread,
Aug 9, 2018, 1:21:34 PM8/9/18
to Paul Brown, SWI-Prolog
I'll try to get my stuff together for you this weekend.

Anne Ogborn

unread,
Aug 9, 2018, 1:22:31 PM8/9/18
to Paul Brown, SWI-Prolog
Don't restrict to using swish, some things don't work well in it (eg example web apps).

Fabrizio Riguzzi

unread,
Aug 9, 2018, 1:29:23 PM8/9/18
to Paul Brown, SWI-Prolog
Program to generate random tile maps for board games

2018-08-09 12:31 GMT+02:00 Paul Brown <pbrow...@gmail.com>:
Haiku generator looks great! I'll certainly have a play with it. This is the sort of project that will capture the interest of people and they can follow along in an afternoon, achieve something, feel proud, and start delving deeper into if they wish. Perfect for the hobbyist.

Web-based language learning sounds fascinating, and it sounds like a wonderful project. However, this "project" isn't really a "project" so much as a collection of simple projects a relative beginner, hobbyist, or learner might wish to do. Kind of like short assignments you would get on a course, except with all the answers!

--
You received this message because you are subscribed to the Google Groups "SWI-Prolog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+unsubscribe@googlegroups.com.

Paul Brown

unread,
Aug 9, 2018, 6:01:05 PM8/9/18
to SWI-Prolog
Tile generator is exciting! I was just wondering about how complex creating a simple game like snake would be earlier today...

I don't think SWISH should be a restriction, but if projects can be done on SWISH I think they should be, that'll be easier for people to play with them in most cases. No hurry on getting everything ready, a trickle would also be fine!

Anne Ogborn

unread,
Aug 9, 2018, 8:40:15 PM8/9/18
to Paul Brown, SWI-Prolog
Paul, There's a video in the Playing with Prolog series about the tile map.


A few of the other PwP videos might be things you could do.

coming up, if/when I get back to PwP, I have a little social robot kit,
could do some fun things with that.



________________________________
From: Paul Brown <pbrow...@gmail.com>
To: SWI-Prolog <swi-p...@googlegroups.com>
Sent: Thursday, August 9, 2018 3:01 PM
Subject: Re: [SWIPL] Re: Prolog for noobs



Tile generator is exciting! I was just wondering about how complex creating a simple game like snake would be earlier today...

I don't think SWISH should be a restriction, but if projects can be done on SWISH I think they should be, that'll be easier for people to play with them in most cases. No hurry on getting everything ready, a trickle would also be fine!


--
You received this message because you are subscribed to the Google Groups "SWI-Prolog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages