logic_programmer

u/logic_programmer


r/prolog•

This is a little tutorial on how to write debuggers for Prolog and Prolog like languages, e.g. the DSL in http://www.reddit.com/r/prolog/comments/303txw/problem_solving_with_layered_design_domain/ I'll give the examples for Prolog as we all know the language.

I first read about the key to tracing Prolog like languages in Tracing Requirements for Multi-Layered Meta-Programming by Bowles and Wilk, in Meta-Programming in Logic Programming by Abramson and Rogers, MIT Press.

Consider the following program:

:- set_prolog_flag(unknown, fail).

a :- b, c ; d.
b :- true.
d :- true.

In Prolog the following query succeeds:

| ?- a.
% yes

Now consider our own little Pro

100

r/prolog•

Just another piece of Prolog code I'm throwing out there. The link at the end of this post will take you to an simple implementation of a language heavily influenced (i.e. I simplified it a wee bit) by Experimenting with Stochastic Prolog as a Simulation Language., Oliva, Gardelli, Viroli, and Omicini. ( http://www-lia.deis.unibo.it/Staff/EnricoOliva/publications/cilc08.pdf)

You can see the code here: http://barrywatson.se/lsi/lsi_stochastic_prolog.html

Note that it uses a few things that your Prolog may not have but the crux of the interpreter is fairly standard stuff.

60

r/prolog•

Bowles and Wilks wrote

A programming methodology often used in AI, as well as in other fields, is stratified or layered design. When faced with a problem, rather than implementing a solution directly in some base language, a new, more appropriate, higher level language is designed in which to express a solution, and this is implemented in the base language. This methodology can have several iterations yielding as a final solution a hierarchy of different languages each more appropriate to expressing the solution than the language below.

This is something that is done quite often by Prolog and Lisp programmers. We've all read the same Prolog books so we've all seen an example of this i

35

r/learnprogramming•

If you've got a soldering iron then I recommend the Elenco MicroMaster MM-8000 kit. It's an old school build your own computer course. You build an 8-bit computer testing it as you go along so you learn about ROM, RAM, the microprocessor, etc. I built one a few years ago and had great fun.

Here's the manual with the lessons: http://www.elenco.com/admin_data/pdffiles/MM8000K1.pdf

Another student's experience: http://skyembers.blogspot.se/2015/01/elencos-micro-master-mm-8000-kit.html

03


You've reached the end of this feed.