Prolog as entertainment

146 views
Skip to first unread message

Anne Ogborn

unread,
Feb 13, 2017, 12:25:59 AM2/13/17
to SWI-Prolog
Stackoverflow has just published an interesting comparison of tags on questions asked on the weekend vs. questions asked during weekdays.

http://stackoverflow.blog/2017/02/What-Programming-Languages-Weekends/?cb=1


What's clear to me is that programmers are much more innovative and functional in their non work hours. It makes me think maybe we're barking up the wrong tree.

I bristle every time I see the xkcd cartoon 'import antigravity', in which one of the characters is floating in midair. He explains to other character that he's simply done 'import antigravity' in Python.

I bristle because I know that Prolog's much, much, much better at making things you simply import and get different functionality.

So maybe we need to aim to capture this recreational programming market.

::Annie is here, playing with SWI-Prolog 9.2.7, which has much improved speech recognition in the robotics package. She's waving her arms in front of the NUI based editor::

Sam Neaves

unread,
Feb 13, 2017, 1:56:59 AM2/13/17
to Anne Ogborn, SWI-Prolog
I am all for playing with Prolog!

Things that could be promoted are Prolog for home automation/ IOT. 
Prolog for web services - extend your tutorial with some project ideas that are fun at home.
Prolog for machine learning/data mining. There are lots of cool Prolog specific algorithms - and buzz words attract weekend programmers? 

Also maybe some projects for children - can you get swi to be a default language on raspberry pi? 

Sam


--
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.

Wouter Beek

unread,
Feb 13, 2017, 2:39:05 AM2/13/17
to Anne Ogborn, SWI-Prolog
Don't forget that academics work on any day of the week.  IOW weekend work is not always recreational.

Jan Burse

unread,
Feb 13, 2017, 7:45:26 AM2/13/17
to SWI-Prolog
Same here, I am doing the important research weekends,
since during the week, I have to do grocery shopping.

Also during weekends the negative alpha, beta and
gramma brain waves are less, also emitted from the

environment, therefore making road for theta and delta
brain waves even in birds, cats, dogs but not in children.

Who knows? Your kid playing Minecraft 7/24 hours?

Anne Ogborn

unread,
Feb 13, 2017, 3:30:55 PM2/13/17
to Sam Neaves, SWI-Prolog
>Prolog for machine learning/data mining. There are lots of cool Prolog specific algorithms - and buzz words attract weekend programmers? 

Ooh! yes, definitely!

If I started doing a weekly or monthly or something 'Playing with Prolog' youtube channel, could I get some of you academics to use something like cplint, etc. to demo something cool?

maybe 


Also maybe some projects for children - 

> Can you get swi to be a default language on raspberry pi? 

NodeRed got on there. I could try. A better approach is probably to make sure an apt install works smoothly on the pi.

Speaking of NodeRed, that'd be a good weekend programmer friendly project - make Prolog talk to NodeRed.

I'm working on a robotic snail. Maybe we can whip up a Prolog centric ROS.
I've seen that the Willow Garage ROS is vulnerable. It's too 'heavy' and clunky, and many robotics people, even serious ones, want something no-fuss, no-muss (that's the point of an ROS). So something that's friendlier to programming at the top level would be appropriate.
Sam, you up for that?

Why isn't there logic programming in Snap! ? It's based on scheme.


Anne Ogborn

unread,
Feb 13, 2017, 3:35:55 PM2/13/17
to Wouter Beek, SWI-Prolog
And people in startups.

And programmers play in the evenings.

But there's an obviously significant difference in the tag clouds of questions submitted to StackOverflow on weekends, demonstrating there's two populations.

This sort of thing is something we've all done. I doubt many people reading this mail list haven't, at some point or another, written something 'just for fun'.

And I'm meeting a suprising number of people who are programming prolog as a hobby.

In some respects programming is becoming a life skill as much as an isolated profession.

Woodworking is a similar skill. While there are professional cabinetmakers, a large fraction of the population has a saw and such minimal tools and sometimes makes things for their home.

Sam Neaves

unread,
Feb 13, 2017, 4:11:32 PM2/13/17
to Anne Ogborn, SWI-Prolog
Yes I would like to help out. I think the idea of a you tube channel is a great one. I did make a couple of vids myself a while back but, I think I made some mistakes in terms of programming style and content delivery so I am not so proud of them..  But hey sometimes shipping an imperfect product is better than no product right?! At some point I would like to make some vids on machine learning, relational learning and ilp as there is not much free accessible content out there. 

A Robot snail sounds great fun, what will it be able to do? 

Anne Ogborn

unread,
Feb 13, 2017, 5:29:03 PM2/13/17
to Sam Neaves, SWI-Prolog
Was mostly asking your specific help on the idea of a Prolog version of ROS, since you made a Prolog driven robot, But would be delighted to have help on youtube channel.

I've done video editing before, but am new to youtube too. Yes, shipping an imperfect product is FAR better than not shipping a perfect one.


>some vids on machine learning, relational learning and ilp as there is not much free accessible content out there.


Neat! I'm sending you my contact info privately, lets pick one of those and just do it to get our feet wet!
> A Robot snail sounds great fun, what will it be able to do?


https://cutebouncingbunnies.wordpress.com/2017/02/08/the-snail/

Fabrizio Riguzzi

unread,
Feb 14, 2017, 5:13:55 AM2/14/17
to Anne Ogborn, Sam Neaves, SWI-Prolog
2017-02-13 21:28 GMT+01:00 'Anne Ogborn' via SWI-Prolog <swi-p...@googlegroups.com>:



>Prolog for machine learning/data mining. There are lots of cool Prolog specific algorithms - and buzz words attract weekend programmers? 

Ooh! yes, definitely!

If I started doing a weekly or monthly or something 'Playing with Prolog' youtube channel, could I get some of you academics to use something like cplint, etc. to demo something cool?
I'd be happy to! 

maybe 

Also maybe some projects for children - 

> Can you get swi to be a default language on raspberry pi? 

NodeRed got on there. I could try. A better approach is probably to make sure an apt install works smoothly on the pi.

Speaking of NodeRed, that'd be a good weekend programmer friendly project - make Prolog talk to NodeRed.

I'm working on a robotic snail. Maybe we can whip up a Prolog centric ROS.
I've seen that the Willow Garage ROS is vulnerable. It's too 'heavy' and clunky, and many robotics people, even serious ones, want something no-fuss, no-muss (that's the point of an ROS). So something that's friendlier to programming at the top level would be appropriate.
Sam, you up for that?

Why isn't there logic programming in Snap! ? It's based on scheme.


Anne Ogborn

unread,
Feb 14, 2017, 2:25:52 PM2/14/17
to Fabrizio Riguzzi, Sam Neaves, SWI-Prolog
>I'd be happy to! 

Ok, Fabrizio, Give us a few days to get organized!

Should we do cplint, or aleph, or?

What's a cool application of cplint? 
Is there some fun or amazing trick you can do with it? 
Something weekend programmers might find cool?

I got a fun mind bend when I understood it was propagating probabilities, not sampling.

Procedural generation of terrain might be a neat application.

Can you do an intro to ILP for a general audience?

What other cool stuff are you working on?



Fabrizio Riguzzi

unread,
Feb 15, 2017, 3:33:13 AM2/15/17
to Anne Ogborn, Sam Neaves, SWI-Prolog
2017-02-14 20:25 GMT+01:00 Anne Ogborn <anni...@yahoo.com>:
>I'd be happy to! 

Ok, Fabrizio, Give us a few days to get organized!

Should we do cplint, or aleph, or?

What's a cool application of cplint? 
Is there some fun or amazing trick you can do with it? 
Something weekend programmers might find cool?
I think I can present two examples
Monty hall puzzle
and 
Truel
They could be presented nicely with an animation (but I don't know how to do animations)

I got a fun mind bend when I understood it was propagating probabilities, not sampling.

Procedural generation of terrain might be a neat application.
This could be interesting, if you describe me what you have in mind I can hack a program 

Can you do an intro to ILP for a general audience?
yes, but that would be less eye catching

What other cool stuff are you working on?

Carlo Capelli

unread,
Feb 15, 2017, 6:26:34 AM2/15/17
to Fabrizio Riguzzi, Anne Ogborn, Sam Neaves, SWI-Prolog
A wish...
Maybe I'm not the only that would appreciate an intro about the relation among the various statistical tools published and Deep Learning


Paulo Moura

unread,
Feb 15, 2017, 7:42:29 AM2/15/17
to SWI-Prolog
Hi,

Surprised that no one mentioned adventure games so far or did I missed it? Some examples here:

https://github.com/LogtalkDotOrg/logtalk3/tree/master/examples/adventure

Cheers,
Paulo
> 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.
>
>
> --
> 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.

-----------------------------------------------------------------
Paulo Moura
Logtalk developer

Email: <mailto:pmo...@logtalk.org>
Web: <http://logtalk.org/>
-----------------------------------------------------------------




Samer Abdallah

unread,
Feb 15, 2017, 10:43:54 AM2/15/17
to Carlo Capelli, SWI-Prolog
On 15 Feb 2017, at 11:26, Carlo Capelli <cc.car...@gmail.com> wrote:

A wish...
Maybe I'm not the only that would appreciate an intro about the relation among the various statistical tools published and Deep Learning
Which statistical tools do you mean? Do you mean probabilistic programming languages 
like CPLINT, ProbLog and PRISM? 

Samer.

To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+...@googlegroups.com.
signature.asc

Fabrizio Riguzzi

unread,
Feb 15, 2017, 11:26:14 AM2/15/17
to Samer Abdallah, Carlo Capelli, SWI-Prolog
2017-02-15 16:43 GMT+01:00 Samer Abdallah <seventy...@gmail.com>:

On 15 Feb 2017, at 11:26, Carlo Capelli <cc.car...@gmail.com> wrote:

A wish...
Maybe I'm not the only that would appreciate an intro about the relation among the various statistical tools published and Deep Learning
Which statistical tools do you mean? Do you mean probabilistic programming languages 
like CPLINT, ProbLog and PRISM? 
from
"SLIPCOVER still requires a target predicate, but it also gathers a set of good theories which can explain predicates from the BK other than the target predicate – this process can be viewed as a form of deep learning, since these intermediate theories will be used to explain the target predicate.
 "

Anne Ogborn

unread,
Feb 15, 2017, 4:09:08 PM2/15/17
to Carlo Capelli, Fabrizio Riguzzi, Sam Neaves, SWI-Prolog
Carlo sez:

>Maybe I'm not the only that would appreciate an intro about the relation among the various statistical tools published and Deep Learning

Oooh! I'd love that!

Anne Ogborn

unread,
Feb 15, 2017, 5:17:05 PM2/15/17
to Anne Ogborn, Paulo Moura, Sam Neaves, SWI-Prolog
> Surprised that no one mentioned adventure games so far or did I missed it? Some examples here:

https://github.com/LogtalkDotOrg/logtalk3/tree/master/examples/adventure

Cheers,
Paulo



Definitely! Ooooh, we gotta do that.

Logtalk was already on a list of topics - an adventure game would be a perfect intro to Logtalk.

We need to get organized, and probably do some learning first, I think, before we do lots of 'guest' episodes. 8cD But we'll do them!

Samer Abdallah

unread,
Feb 15, 2017, 5:29:03 PM2/15/17
to Anne Ogborn, Carlo Capelli, Fabrizio Riguzzi, Sam Neaves, SWI-Prolog
Hello all,

I don’t want to step on anyone’s toes, but I think the referenced analogy
and deep learning is quite thin. The big thing about deep learning was that
it extended the scope of large, numerical, gradient based function approximators
(aka neural networks) to allow deep composition of multiple layers in complex
configurations. This was made possible in large part by the adoption of automatic
differentiation methods. In probabilistic programming (referring now to the
whole field: functional, logical, discrete valued, continuous valued), deep is what we got
from the outset - it just means that functions or predicates can be composed
in arbitrarily nested ways. The simplest recursion already implies unbounded
depth. The hard part is the learning and inference while adhering to the correct
probabilistic composition semantics. Deep learning systems get away with simple
gradient propagation because their modular components are largely used as
function approximators, whereas in probabilistic programming, the modular
components are parameterised distributions, whose composition is governed
by a more complex rule than the a simple dataflow model, but rather an
integral or sum over a space of values (lookup probability monads and their
associated ‘bind operation). Whether or not a particular probabilistic programming
language does these sum literally, or by MCMC or whatever, carrying the process
through all the twists and turns of a Turing complete language is hard. Also,
in Bayesian inference, we are not trying to optimise the parameters of a model
to particular values, but rather trying to estimate their posterior distribution
given all the data we have. In deep learning, Bayesian techniques are beginning
to get some attention, but there are not in widespread use.

Having said all of that, I do see a time when the difference between the two
approaches fades away. This is happening on a number of fronts:
firstly, current deep learning systems let you write loops corresponding to
mapping or reducing numerical operations over sequences of vectors, and they
also allow other constructs like conditionals - these are all operations supported by
automatic differentiation; secondly, there is a growing amount of work where
neural modules (or layers) are combined more ‘algebraically’, for example,
in recursive neural networks and neural network grammars; thirdly, there is a
body of work looking into how to represent algebraically structured data (basically,
terms like we have in Prolog) in fixed dimensional vector spaces, so that composite
objects like lists, syntax trees, or linguistic semantic descriptions can be manipulated
by a fixed-size neural network; fourthly, probabilistic programming systems that work
with real-valued variables (e.g. Stan) already use some of the same techniques as
deep learning, e.g. automatic differentiation for doing Hamiltonian Monte Carlo.
All in all, an exciting prospect, I think.

best wishes,
Samer
> --
> 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.
signature.asc

Anne Ogborn

unread,
Feb 15, 2017, 5:58:47 PM2/15/17
to Samer Abdallah, Carlo Capelli, Fabrizio Riguzzi, Sam Neaves, SWI-Prolog
Samer, could we get you on some time to show some of the projects at the Centre for Digital Music?

That fits in 'weekend programmer' orientation.

Fabrizio Riguzzi

unread,
Feb 16, 2017, 2:26:32 AM2/16/17
to Samer Abdallah, Anne Ogborn, Carlo Capelli, Sam Neaves, SWI-Prolog
Nice analysis Samer

> To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+unsubscribe@googlegroups.com.

Carlo Capelli

unread,
Feb 16, 2017, 3:01:56 AM2/16/17
to Samer Abdallah, Anne Ogborn, Fabrizio Riguzzi, Sam Neaves, SWI-Prolog
Thanks Samer, Fabrizio

From the Stan hint, I can 'infer' that, for instance, pack lbfgs (provided by Fabrizio) could play a well defined role.
This give me some chance to orient in such complex, evolving documentation (I tried to read Fabrizio' suggested document, but it's way too complex... sorry).



2017-02-15 23:28 GMT+01:00 Samer Abdallah <seventy...@gmail.com>:
> To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+unsubscribe@googlegroups.com.

Anne Ogborn

unread,
Feb 16, 2017, 12:18:32 PM2/16/17
to Fabrizio Riguzzi, Sam Neaves, SWI-Prolog

>>Procedural generation of terrain might be a neat application.
>This could be interesting, if you describe me what you have in mind I can hack a program

Procedural terrain generation is a technique used by games.

Drawing maps is laborious, and limits the size of world you can give your players to wander around in.

So there's a lot of interest in creating maps that 'make sense' to humans, yet are randomly generated.

The simplest version of this is to make the map from tiles - so this tile has a farm, that one a north-south running river, this one a road with an elbow. This often works well with game play as well- there's no question what sort of terrain you're in.

There are lots of free sets of tiles available on the internet. Google image search "game tile map" brings up a lot.

But there are strong constraints (sections of road have to match up) and weak ones (trees tend to grow near rivers, towns are rarely in the mountains).

So it seemed like something that might be an interesting application of cplint.

Anne Ogborn

unread,
Feb 17, 2017, 12:52:01 PM2/17/17
to SWI-Prolog
A while back dmiles and I did a game jam with artist Diane Salles. We were going to build a small MMO, but got bogged down in

A few folks are going to be hacking on it this saturday after 2pm. If you're interested, appear in ##prolog and ping me (Anniepoo) or aindilis.

Fabrizio Riguzzi

unread,
Feb 19, 2017, 5:43:24 AM2/19/17
to Carlo Capelli, Samer Abdallah, Anne Ogborn, Sam Neaves, SWI-Prolog
2017-02-16 9:01 GMT+01:00 Carlo Capelli <cc.car...@gmail.com>:
Thanks Samer, Fabrizio

From the Stan hint, I can 'infer' that, for instance, pack lbfgs (provided by Fabrizio) could play a well defined role.
Yes, pack lbfgs does gradient descent 
Reply all
Reply to author
Forward
0 new messages