Re:Logica, a novel open-source logic programming language
by YeGoblynQueenne on Saturday April 17, 2021 @01:10PM
(#26845784)
I use Prolog for my research. I study Inductive Logic Programming (ILP) for my
PhD. ILP is a field in the intersection of machine learning and logic
programming, that studies approaches to learning logic programs from examples,
background knowledge and language bias (it helps to think of background
knowledge as a library of sub-routines from which a program is to be composed
and to think of language bias as constraints on the structure of learned
programs).
Obviously Prolog is well-suited for this task, but there's a reason why you
don't often hear of "Inductive Python Programming" or "Inductive Java
Programming", say. The reason is that imperative languages tend to have lots of
specialised syntax, for example for class declarations, loops, variable
assignment etc. Whereas Prolog syntax consists entirely of one kind of
expression, the Horn clause. So for instance, to learn a program with a "loop"
in Prolog you "only" need to add a recursive clause to the program, where a
recursive clause is simply an ordinary Horn clause with the same predicate
symbol in a head literal and one or more body literals. To learn a program with
a loop in Python you have to add the loop to the program as a specialised
structure with its own peculiar syntax.
Also, because in Prolog everything is a Horn clause, examples, background
knowledge and language bias can be (and often are) represented as Prolog
programs themselves, so it's possible to learn new background knowledge, new
language bias and even new examples. That'd be tricky to do in Python where
examples, say, would be not programs, but the inputs of and outputs to programs.
The sister field to ILP, of Inductive Functional Programming exploits the
homoiconicity of functional languages in similar ways.
Finally, Prolog is a language with a deductive inference algorithm as an
interpreter and it turns out deduction can be sort of inverted into induction.
Which is to say, we can go from reasoning to learning, with but a tiny little
hop. Well, ish.
If you're interested in more details about my work, there's links in my profile.
Obviously Prolog is well-suited for this task, but there's a reason why you don't often hear of "Inductive Python Programming" or "Inductive Java Programming", say. The reason is that imperative languages tend to have lots of specialised syntax, for example for class declarations, loops, variable assignment etc. Whereas Prolog syntax consists entirely of one kind of expression, the Horn clause. So for instance, to learn a program with a "loop" in Prolog you "only" need to add a recursive clause to the program, where a recursive clause is simply an ordinary Horn clause with the same predicate symbol in a head literal and one or more body literals. To learn a program with a loop in Python you have to add the loop to the program as a specialised structure with its own peculiar syntax.
Also, because in Prolog everything is a Horn clause, examples, background knowledge and language bias can be (and often are) represented as Prolog programs themselves, so it's possible to learn new background knowledge, new language bias and even new examples. That'd be tricky to do in Python where examples, say, would be not programs, but the inputs of and outputs to programs.
The sister field to ILP, of Inductive Functional Programming exploits the homoiconicity of functional languages in similar ways.
Finally, Prolog is a language with a deductive inference algorithm as an interpreter and it turns out deduction can be sort of inverted into induction. Which is to say, we can go from reasoning to learning, with but a tiny little hop. Well, ish.
If you're interested in more details about my work, there's links in my profile.