Questions tagged [failure-slice]

A failure-slice is a fragment of a Prolog program obtained by inserting one or more `false` goals somewhere in it. Failure-slices help to localize reasons for universal non-termination and instantiation errors of a pure monotonic Prolog program. They also help to give a lower bound for the number of inferences needed. It is a concrete program-slicing technique.

A failure-slice is a fragment of a Prolog program obtained by inserting one or more false goals somewhere in it. Failure-slices help to localize reasons for universal and instantiation errors of a pure monotonic Prolog program. They also give a lower bound for the number of inferences needed. It is a concrete technique.

References

Localizing and explaining reasons for non-terminating logic programs with failure-slices

125 questions
0
votes
1 answer

Prolog stucks after giving the result

So I have this knowledge base and I am trying to achieve the goals in the code given as comments. %format of foo: foo(Tag,NumList) foo(a, [2, 4]). foo(b,[2, 8, 8, 6,2]). foo(c,[4, 8, 8, 8, 7]). foo(d,[7, 8, 8, 2]). foo(e,[5, 8, 9,…
0
votes
1 answer

Why do i get a stack limit exceeded error when defining a predicate that convert the relation of two atoms?

I want to know why does the program goes in an infinite recursion in those cases: ?- love(kay, amanda). and ?- love(rob, amanda). And here is the code: love(amanda, kay). love(kay, geo). love(geo, rob). love(X, Y) :- love(X, Z), love(Z,…
0
votes
1 answer

Some good answers by the rule, but cannot get them all

These are my rules, where my problem lies: get_row([H|_],1,H):-!. get_row([_|T],I,X) :- I1 is I-1, get_row(T,I1,X). get_column([],_,[]). get_column([H|T], I, [R|X]):- get_row(H, I, R), get_column(T,I,X). good_by_coulmns(Solution)…
Falcon
  • 29
  • 6
0
votes
2 answers

Prolog raises out of local stack for no good reason

I'm trying to implement Levenshtein distance in Prolog. The implementation is pretty straightforward: levenshtein(W1, W2, D) :- atom_length(W1, L1), atom_length(W2, L2), lev(W1, W2, L1, L2, D), !. lev(_, _, L1, 0, D) :- D is L1,…
s1ddok
  • 4,615
  • 1
  • 18
  • 31
0
votes
1 answer

Magic Square NxN

I'm new to Prolog and I'm trying to write fully working magic square program, but to say the truth I don't really know how to do, I have started but I feel that I'm doing it wrong. I'm sharing my code and I hope someone will help me, now when…
EasyCode
  • 47
  • 1
  • 8
1 2 3
8
9