Non Monotonicity/Defeasibility Strategies and Other Stuff

Not really. If it doesn’t fit one page, I guess its not anymore sweet
fragrance “vanilla”. More a bagful of potatoes with a musty smell.
How would you make a teaching friendly version of your claim?

Starting with “vanilla” interpreter, pardon the cuts:

solve(true) :- !.
solve((A,B)) :- !, solve(A), solve(B).
solve(H) :- clause(H, B), solve(B).

What would be the extra for “abduction”? In my mind I
have like one extra line and some DCG magic.

Edit 07.01.2023
I took SLD what it is, no negation, unlike SLDNF. The SLDNF meta
interpretater has one extra line for NF. Here is the solution for some
SLD “abduction”, using DCG to return the abducted literals:

/* SWI-Prolog 9.1.0 */
solve(true) --> !.
solve((A,B)) --> !, solve(A), solve(B).
solve(A) --> {abducible(A)}, !, [A].
solve(H) --> {clause(H, B)}, solve(B).

Here is an example run:

/* SWI-Prolog 9.1.0 */
engine(turns) :- battery(nonempty).
abducible(battery(_)).

?- solve(engine(turns), L, []).
L = [battery(nonempty)].

I read the news but I had forgotten his connection to logic programming. I had interacted with him on HN where a barbarous mob of ignorant fools used to downvote his comments because he kicked established computer science orthodoxies in the shins and that’s too much for some peoples’ education to handle, I guess. He was a maverick and a pioneer to the end of his life. Would it that I could be like him.

That’s harsh :stuck_out_tongue:

The inductive meta-interpreter is small, including its clause-fetcher (like clause/2) that fetches second-order clauses and clauses induced so-far. I don’t know if it’s “one page” because I don’t know what is “one page”. About double the space is taken up by my comments, as is typical of my code. The rest of the code is pre- and post-processing, constraints, and a learning loop that passes positive and negative examples to the meta-interpreter. Those are not strictly necessary to understand the meta-interpreter.

Note that in ILP, “vanilla” is a reclaimed word. It is used somewhat derogatorily to mean ILP that isn’t probabilistic. The current fad is to try and mix probabilities with ILP, but that is such a mess that there is at least one such attempt made every time a paper is written. MIL is not probabilistic so Louise’s meta-interpreter is “vanilla”.

Yes, that is just the kind of modification I’m talking about. Nice and simple, isn’t it?

Btw, this is the vanilla part in Louise:

prove(true,_K,_MS,_Ss,Subs,Subs):-
    !.
prove((L,Ls),K,MS,Ss,Subs,Acc):-
    prove(L,K,MS,Ss,Subs,Subs_)
    ,prove(Ls,K,MS,Ss,Subs_,Acc).
prove((L),K,MS,Ss,Subs,Acc):-
    L \= (_,_)
    ,L \= true
    ,clause(L,K,MS,Ss,Subs,Subs_,Ls)
    ,prove(Ls,K,MS,Ss,Subs_,Acc).

The differences with solve/1 in your comment are a) the two guard literals in the last clause, b) the call to the custom clause-fetcher clause/7, and c) some additional arguments.

The custom clause-fetcher is necessary because we want to resolve the clauses of the program derived so-far with new clauses, and with second-order clauses. This is what ultimately makes the proof an inductive one. You can omit this custom fetcher and use clause/2 instead if you write every induced clause to the dynamic database, and then remove it when the proof fails, etc, but while that would make the meta-interpreter simpler, the whole program would be a bug-ridden mess that would be much harder to understand. I know because an earlier version did just that and it was an endless pain in the entailment.

The additional arguments are there to store the set of inducible symbols (Ss) the set of second-order clauses (Ms) and two accumulator variables (the last two arguments) necessary to return the induced clauses at the end of the proof. These would also collect abduced atoms in the abductive modification I describe above. Again, if you wanted to keep everything in three lines and ten literals, plus the cuts, you could write everything to the dynamic database, but, why? That would make it all a lot more painful to follow the program.

Of course the main attraction to the inductive meta-interpreter above is that it’s inductive, not that it’s vanilla. With impeccable reviewer style you focused on the part of the claim that was least consequential :stuck_out_tongue:

But if you think that an inductive Prolog meta-interpreter can be written that is simpler than the one above, and that is “more vanilla”, please go ahead and demonstrate. I for one would be very curious to see what that looked like.

Looking at vanilla separately from the full phrase “vanilla meta-interpreter” is
probably not legit. Thats like looking at butter in buttermilk.

I didn’t invent the term “vanilla meta-interpreter” (*). Also the usual “vanilla meta-interpreter”
is less “meta” than what one would think. Try doing the following queries with the
usual “vanilla meta-interpreter”:

?- solve(solve(true)).

?- solve(clause(p,X)).

A “vanilla meta-interpreter” which is meta-circular would need to be able to answer the
above queries as well, it is then likely that the “vanilla meta-interpreter” can interpret itself.

(*) The non-meta-circular “vanilla meta-interpreter” is for example found here,
thats one of the earliest references I could find.

Program 17.5 A meta-interpreter for pure Prolog
Sterling & Shapiro: The Art of Prolog, MIT Press, 1986
https://mitpress.mit.edu/9780262691635/the-art-of-prolog/

Maybe we can go more back in time?
Well Sterling & Shapiro give this explanation:

Unbenannt

1 Like

I didn’t think that you invented the term “vanilla”, anyway I’ve known it for a long time even if I don’t know where it comes from.

But listen, what I’m trying to say above is that the structure of the meta-interpreter is a distraction from its much more interesting property, that of being inductive. Let’s not waste time with irrelevancies.

You said that SLD-Resolution can only do deduction. It turns out, it can also do induction and adbuction. You saw yourself how simple and easy it is to do abduction. Induction is a little more complicated … a lot more complicated actually but it gets a lot simpler once you figure out how to do it.

This is something new. It is new in logic programming and in Inductive logic programming, in fact it’s exactly what “inductive” in “ILP” means, and it’s the first time in 30 years that it’s become a reality and not just an aspiration. And I think that the three modes of inference can actually be combined to create something even more powerful and useful. This should be useful information, right?

What do you mean by inductive? The usual saying is, it is a pure Prolog
program itself, which is synonymous to it is a definite program, although
this term is not anymore so much in use. What I gave as solve/1

wasn’t pure, because I used cuts. But I demanded pardon. What you gave
as prove/6 wasn’t pure either since it had (\=)/2 and a cut. A pure version
is found in Sterling & Shapiros book. It requires that clause/2 doesn’t bark

at (,)/2 or true/0, so that the “vanilla meta-interpreter” simply falls through
and can do its job. The “vanilla meta-interpreter” is not something practical,
rather a teaching device. Unlike a bagful of potatoes which could be

a more practical thing.

Edit 07.01.2023
Thats the pure thingy, no cuts and no (\=)/2, doesn’t work with the modern
ISO clause/2 anymore. Already the modern ISO clause/2 cannot access
static predicates. So its a clause/2 from another era:

image

Well if you’re making historical references that’s more interesting to me. A couple of days ago I had an online conversation about Prolog and meta-interpreters come up (they tend to, around me). My interlocutor said that they were listening to a talk by Sterling who said that meta-interpreters where invented by Warren, and then Kowalski who was in the audience stepped up to say that no, it was Colmerauer. This is the relevant part of my online discussion:

Just one personal recollection (from memory) which probably also influences my view on the Kowalski-Colmerauer relation. At a META 90 tutorial/talk about meta interpreters, Sterling attributed the origin of meta interpreters to Warren and the DEC10 manual. Kowalski responded (publicly during the talk) that this was well known to Colmerauer, well before Warren ever got into Prolog.

From here: > [3] What does the DEC10 Prolog manual say about the occurs check? See I.2.1. O... | Hacker News

Which is kind of weird given the Sterling & Shapiro quote, who also attributes meta-interpreters to Colmerauer. Perhaps my interlocutor misremembered.

I mean that, given a Horn goal and a set of first- and second-order definite clauses, it derives a new set of definite clauses that entail the atoms in the goal.

More formally, if B is a set of first-order definite clauses, M is a set of second-order definite clauses and ←e is an atomic Horn goal, such that B ∧ M |= e then an inductive meta-interpreter like the one I pasted above derives a set H of first-order clauses such that B ∧ M |= H and B ∧ H |= e.

So it’s a meta-interpreter that learns Prolog programs from Prolog programs.

Well you don’t refer to the “vanilla meta-interpreter” from Program 17.5 then.
There is no way that Program 17.5 derives some definite clauses,

What Program are you exactly refering to? Do you have some reference?
Do you mean some abductive extension of the vanilla meta-interpreter?

Like buttermilk with some rum in it?

I mean the meta-interpreter in this comment that I posted above:

I think we’re being confused because I mentioned that “you’ll recognise its structure as that of a vanilla meta-interpreter”, with which you disagree. I meant that it resembles the vanilla meta-interpreter. It’s not the vanilla meta-interpreter. But the structure, or the flavour, is not the point. The function is the point.

Unlike Program 17.5 from Stewart & Shapiro its not a complete program.
Nowbody knows what it does. Could you be more specific where the
full meta-interpreter is found? And whats the usual name given to this

meta-interpreter. I am sure its name is not only “vanilla meta-interpreter”.

Edit 07.01.2023
Ok, you wrote meta-interpreter in my MIL system, Louise. What
is Louise, some acronym? What is a MIL system, is this a typo?

The meta-interpreter is found in the source file that I linked to, above, in this comment:

You then replied to say that this meta-interpreter is not “vanilla”. You said so in this comment:

I thought that meant you had a look at the source file I linked to and found the meta-interpreter’s flavour not to your liking. Sorry if I misunderstood this, but I’m confused now.

Ah, OK, yes, now we’re on the same page :slight_smile:

Louise is not an acronym. It followed an earlier implementation of MIL, called “Thelma”, which is an acronym: for Theory Learning Machine. Then I wrote a new program that I thought was just a curiosity and I wanted a name for it so I called it Louise. As these things tend to, it stuck (meaning I made a couple presentations where I used it and then I was advised to not change it to avoid confusing people who had seen my presentation). To be honest, by that point I was all out of funny acronyms anyway.

“MIL” is “Meta-Interpretive Learning” (see my earlier post). This is a new setting for Inductive Logic Programming that is basically SLD-Resolution with a second-order program.

But I did give you a reference to Louise. I’m giving you inter-thread references because that’s where I gave the out-of-thread references. See this post:

That’s where I linked you to the Louise repository. I didn’t link you to the paper because it’s long and boring and I didn’t think you would read it anyway.

Also because it’s wrong and confused and I understand things much better now and I’m embarrassed every time anyone mentions that paper :confused:

Don’t be mean! He’s my supervisor and he’s called Muggleton. He’s the guy behind most of the good ideas in ILP, and I can’t do anything about that, neither can he or anybody else.

The breakthrough of MIL is that it can learn recursion and do predicate invention without the restrictions of earlier approaches. Edit: Louise uses a polynomial-time algorithm for MIL and that’s the main contribution of the paper you cite above (“Top Program Construction and Reduction for Polynomial-Time Meta-Interpretive Learning”).

No, that’s the point of my earlier posts here: I’m trying to figure out how to transfer the intuitions in s(CASP) to an inductive logic programming setting, with Louise and MIL. The motivation for that is to handle uncertainty in a purely symbolic framework, like s(CASP) does, but for learning, and not only reasoning.

I can’t tell you much more than that because that’s all I have at the moment, but the idea is to learn Prolog programs with some kind of representation of uncertainty, like the “shades of truth” from the s(CASP) paper discussed earlier.

Edit: there is an ILP approach that learns ASP programs. See here for references:

https://ilasp.com/research

Ooh thank you, I’ll look into that constraint based revision it sounds very similar to what I’ve arrived at!

I think in cases of unrepairable contradiction, for my use case at least, it would fall back to a humans playing to make a judgement call. And would flag the rules involved in creating the game at hand as unclear and or broken so the system designers can clarify or ratify them.

More than once in this endeavour I’ve found genuine contradictions in some of the rule sets. Some arise from linguistic ambiguity. But others have just been in accounted for contradictions in very big rule sets.

It’s a very particular use case, but I can see it being useful in other domains filled with contradictions and incomplete rules. Business rules for one, or even expert systems with multiple designers. Where there may be multiple designers or maintainers with inconsistent belief systems.

Edit:
Oh wow, I’ve got some catching up to do I just realised how long the thread got over night. Will try to catch up later today! Haha

It’s getting late now and I’ll be traveling tomorrow so I may not have time to continue our conversation which I’m enjoying. I have to say that I don’t know what a valuation lattice is and I couldn’t find out with a quick search on the internet. Can you please clarify?

It’s the non-monotonicity I’m interested in, specifically the non-monotonicity of NAF. NAF, or rather the CWA itself is already a simple way to handle uncertainty (by ignoring it, essentially). Non-monotonicity of NAF means that a theory can be updated whenever new evidence becomes available, so there is no risk to be stuck with a bad initial theory as when reasoning monotonically.

In a learning setting this means that we can continue learning, and updating, new theories as new training examples become available. The only problem is that it’s tricky to have SLDNF-resolution be complete for normal programs.

I think non-monotonicity is more interesting in a learning setting, where we want to be able to update learned theories automatically.

Note that SWI s(CASP) also runs in SWISH. See SWISH -- SWI-Prolog for SHaring for this example.

1 Like

I guess have to wait a little, till I can try SWISH s(CASP). It currently
shows me the below error message. Unless you have somewhere a SWI

WASM s(CASP) example served from another servrer, does this already
exist? I guess the Ciao Playground s(CASP) is also client side only, right?

Edit 08.01.2023
Ok, its up and running now: