https://github.com/shonfeder/99-lambda-prolog-problems
99 λProlog Problems (eventually)
https://github.com/shonfeder/99-lambda-prolog-problems
99problems lambda-prolog prolog
Last synced: 3 months ago
JSON representation
99 λProlog Problems (eventually)
- Host: GitHub
- URL: https://github.com/shonfeder/99-lambda-prolog-problems
- Owner: shonfeder
- Created: 2021-11-29T11:15:36.000Z (over 3 years ago)
- Default Branch: trunk
- Last Pushed: 2022-05-01T00:52:51.000Z (about 3 years ago)
- Last Synced: 2025-02-28T16:17:05.572Z (3 months ago)
- Topics: 99problems, lambda-prolog, prolog
- Language: AMPL
- Homepage:
- Size: 27.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
README
#+TITLE: 99 λProlog Problems
A (WIP) adaptation of the classic [[https://sites.google.com/site/prologsite/prolog-problems][99 Prolog Problems]] by [[https://sites.google.com/site/prologsite/author][Werner Hett]] to
higher-order logic programming in [[http://www.lix.polytechnique.fr/~dale/lProlog/][λProlog]].* The spirit of the problems
Before undertaking the problems, you may wish to review this slight adaptation
of Hett's wonderful guidance (additions in =[]=):#+begin_quote
The purpose of this problem collection is to give you the opportunity to
practice your skills in [higher-order] logic programming. Your goal should be to
find the most elegant solution of the given problems. Efficiency is important,
but logical clarity is even more crucial. Some of the (easy) problems can be
trivially solved using built-in predicates. However, in these cases, you learn
more if you try to find your own solution.Every predicate that you define should begin with a comment that describes it in
a declarative statement. Do not describe procedurally, what the predicate does,
but write down a logical statement which includes the arguments of the
predicate, [and then describe the flow of data through the unification of terms].[Construct types to formalize the possible data for the predicates and
functions, then specify the types and modes for their arguments.]
#+end_quote* The problems
#+begin_quote
The problems have different levels of difficulty. Those marked with a single
asterisk (*) are easy. If you have successfully solved the preceeding problems
you should be able to solve them within a few (say 15) minutes. Problems marked
with two asterisks (**) are of intermediate difficulty. If you are a skilled
Prolog programmer it shouldn't take you more than 30-90 minutes to solve them.
Problems marked with three asterisks (***) are more difficult. You may need more
time (i.e. a few hours or more) to find a good solution.
#+end_quote- [[file:problems/lists.org][Lists]]
* The solutions
Solutions are written targeting the [[https://github.com/LPCIC/elpi][Elpi]] dialect and tested by running with
Elpi.- [[file:solutions/lists.mod][Lists]]