Sujet : --- OLCOTT BANNED ---
De : janburse (at) *nospam* fastmail.fm (Mild Shock)
Groupes : sci.logicDate : 09. Jul 2024, 21:05:23
Autres entêtes
Message-ID : <v6k1li$dolj$1@solani.org>
References : 1 2 3 4 5
User-Agent : Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.18.2
In unification with occurs check cycles in a graph
are prevented before they happen. You are such a moron.
The "occurs check" does that. It checks V ∈ T, BEFORE
a variable V gets instantiated to T.
On the other hand acyclic_term/1 can figure out whether
a term as variable V instantiated to T, where V ∈ T,
AFTER a cycle allowing unification has been performed,
i.e. the ordinary (=)/2.
You are an idiot, you confuse these predicate:
- acyclic_term/1
With this predicate:
- unify_with_occurs_check/2.
Usually unify_with_occurs_check/2 is not implemented as:
/* not how it is done */
unify_with_occurs_check(X,Y) :-
X = Y,
acyclic_term(X).
The problem is the above wouldn't allow enough fast failure.
Instead it is usually implemented as follows,
Just consult Rihcard O'Keefes File METUTL.PL :
% unify(?X, ?Y)
% Try to unify X and Y, wih occurs check.
% Further down in this file is the Occurs Check.
unify(X, Y) :-
var(X),
var(Y),
!,
X = Y. % want unify(X,X)
unify(X, Y) :-
var(X),
!,
occurs_check(Y, X), % X is not in Y
X = Y.
unify(X, Y) :-
var(Y),
!,
occurs_check(X, Y), % Y is not in X
X = Y.
unify(X, Y) :-
atomic(X),
!,
X = Y.
unify(X, Y) :-
functor(X, F, N),
functor(Y, F, N),
unify(N, X, Y).
unify(0, _, _) :- !.
unify(N, X, Y) :-
arg(N, X, Xn),
arg(N, Y, Yn),
unify(Xn, Yn),
M is N-1,
!,
unify(M, X, Y).
occurs_check(Term, Var) :-
var(Term),
!,
Term \== Var.
occurs_check(Term, Var) :-
functor(Term, _, Arity),
occurs_check(Arity, Term, Var).
occurs_check(0, _, _) :- !.
occurs_check(N, Term, Var) :-
arg(N, Term, Arg),
occurs_check(Arg, Var),
M is N-1,
!,
occurs_check(M, Term, Var).
http://www.picat-lang.org/bprolog/publib/metutl.htmlBye
olcott schrieb:
On 7/9/2024 11:12 AM, Mild Shock wrote:
>
Fuck off asshole. Prolog is irrelevant for
the minimal logic posts. I only made this
joke, but it has nothing to do with occurs check:
>
> Meanwhile I am going back to my tinkering with my
> Prolog system, which even provides a more primitive
> logic than minimal logic, pure Prolog is minimal
>
> logic without embedded implication.
>
You even don't know what the occurs check is,
and for what it is used.
>
It detects cycles in the directed graph of the expression's
evaluation sequence as a paraphrase of Clocksin & Mellish indicates.
If the occurs check is used, then
olcott schrieb:
On 7/9/2024 10:14 AM, olcott wrote:
On 7/9/2024 4:04 AM, Mild Shock wrote:
>
The full time idiot olcott should be
put in jail, and the key should be thrown away.
All he can do is spam other peoples threads
with his crazy lovebird chirping.
>
I initially thought that you would agree with me
about Prolog and not dismiss what I said out-of-hand
without review.
>
>
>