💡Compiling Prolog to Forth
https://vfxforth.com/flag/jfar/vol4/no4/article4.pdf
#prolog #forth #programming #software #compilers #computerscience #sc #logicprogramming
💡Compiling Prolog to Forth
https://vfxforth.com/flag/jfar/vol4/no4/article4.pdf
#prolog #forth #programming #software #compilers #computerscience #sc #logicprogramming
ΛProlog: Logic programming in higher-order logic
https://www.lix.polytechnique.fr/Labo/Dale.Miller/lProlog/
#HackerNews #ΛProlog #LogicProgramming #HigherOrderLogic #HackerNews #TechNews
@screwlisp @kentpitman regarding the discussion we had after the #LispyGopherClimate show ended, MiniKanren is logic programming language embedded in Scheme (sort-of like a Prolog implemented in Scheme and coded with S-expressions), and you can use machine leaning methods like neural networks to guide the search tree of the goal solver mechanism. This paper is an example of what I was talking about.
Even before LLMs were invented, MiniKanren was able to do program synthesis using purely symbolic logic. They developed a prototype called Barliman where you would provide example input->output pairs as constraints, and using a constraint solver, could generalize those examples to a function that generates any output for any input. As a simple example, you could give it the following input-output pairs:
…and the constraint solver could determine that you are trying to implement the append function for lists and write the code automatically — without LLMs, using purely symbolic logic.
As you might expect, the solver could be very slow, or even diverge (never returning an answer). The paper I mentioned above talks about using neural networks to try to guide the constraint solver to improve the performance and usefulness of the results returned by the solver.
Now imagine applying this technique to other domains besides code generation or optimization, for example, auto-completion, or cache pre-fetching, and building it into a programmable computing environment like Emacs. You could have a tool like “Cursor,” but instead of using LLMs, it uses classical computing and constraint solvers, while taking a fraction of the amount of energy that LLMs use.
#tech #software #AI #LLM #MachineLearning #NeuralNetwork #ConstraintLogic #ConstraintSolver #LogicProgramming #Prolog #MiniKanren #Emacs #Lisp #Scheme #SchemeLang #ProgramSynthesis

Logic programming languages present clear advantages in terms of declarativeness and conciseness. However, the ideas of logic programming have been met with resistance in other programming communities, and have not generally been adopted by other paradigms and languages. This paper proposes a novel way to incorporate logic programming in an existing codebase in a typed functional programming language. Our approach integrates with the host language without sacrificing static typing, and leverages strengths of typed functional programming such as polymorphism and higher-order. We do so by combining three ideas. First, we use the extensible types technique to allow values of the host language to contain logic variables. Second, we implement a unification algorithm that works for any data structure that supports certain operations.Third, we introduce a domain-specific language to define and query predicates. We demonstrate our proposal via a series of examples, and provide aids to make the notation convenient for users, showing that the proposed approach is not just technically possible but also practical. Our ideas have been implemented in the language Haskell with very good results.
https://gitlab.com/b2495/fleng
A compiler for the concurrent logic programming languages FGHC, Strand, KL1 and PCN.
𝗣𝗿𝗼𝗹𝗼𝗴 𝗯𝘆 𝗘𝘅𝗮𝗺𝗽𝗹𝗲
A short course developed specifically for anyone who struggled with the traditional university courses and textbooks.
The focus is on concepts, and building confidence through short hands-on examples and exercises.
I actually had a lot of fun writing it myself ! 😄