Re: Nakano Proposition 2 in SWI-Prolog (Was: How to make cyclic terms)

Liste des GroupesRevenir à s logic 
Sujet : Re: Nakano Proposition 2 in SWI-Prolog (Was: How to make cyclic terms)
De : janburse (at) *nospam* fastmail.fm (Mild Shock)
Groupes : sci.logic
Date : 09. Jan 2025, 13:37:44
Autres entêtes
Message-ID : <vlofuo$21qlu$1@solani.org>
References : 1 2 3 4 5 6 7 8 9
User-Agent : Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0 SeaMonkey/2.53.20
Hi,
In SWI-Prolog, the example doesn't need System F
or Nakano Recursive Types. It simply works with
the congruence relation itself,
if you want to bar that the Curry Paradox emerges,
you have to replace the de Bruijn Variable clause,
by an unify_with_occurs_check/2 based rule:
/* de Bruijn Variable */
typeof(N, L, A) :- integer(N),
    nth0(N, L, B),
    unify_with_occurs_check(A, B).
Now the program uses another congruence relation
among Prolog terms. And the example doesn't work anymore.
Now already the self application fails:
?- typeof(lam(0*0), [], A).
false.
Needless to say that subsequently the Curry
Paradox fails as well:
?- typeof(lam(0*0)*lam(0*0), [], A).
false.
Bye
P.S.: What are de Bruijn indexes:
In mathematical logic, the de Bruijn index is a tool
invented by the Dutch mathematician Nicolaas Govert
de Bruijn for representing terms of lambda calculus
without naming the bound variables.
https://en.wikipedia.org/wiki/De_Bruijn_index
Mild Shock schrieb:
Hi,
 Or in SWI-Prolog:
 /* de Bruijn Variable */
typeof(N, L, A) :- integer(N),
    nth0(N, L, A).
/* de Bruijn abstraction */
typeof(lam(S), L, A -> B) :-
    typeof(S, [A|L], B).
/* Modus Ponens */
typeof((S*T), L, B) :-
    typeof(S, L, (A -> B)),
    typeof(T, L, A).
 ?- typeof(lam(0*0), [], A).
A = (_S1->_A), % where
     _S1 = (_S1->_A).
 ?- typeof(lam(0*0)*lam(0*0), [], A).
true.
 The last query gives simply true without A constrained.
You could also try this here instantiating A, and
you will see it works for any A:
 ?- typeof(lam(0*0)*lam(0*0), [], a).
true.
 ?- typeof(lam(0*0)*lam(0*0), [], (a->b)).
true.
 ?- typeof(lam(0*0)*lam(0*0), [], (b->a)).
true.
 Bye
 Mild Shock schrieb:
>
See here:
>
A Modality for Recursion
Hiroshi Nakano - 2000 - Zitiert von: 237
https://www602.math.ryukoku.ac.jp/~nakano/papers/modality-lics00.pdf
>
Even if you disband cyclic terms in your
model, like if you adhere to a strict Herband model.
If the Herband model has an equality which is a
>
congruence relation ≌. Nakano's paper contains
an inference rule for a congruence relation ≌.
When you have such a congruence relation, you can
>
of course derive things like for example for a certain
exotic recursive type C, that the following holds:
>
C ≌ C -> A
>
You can then produce the Curry Paradox in simple
types with congruence. And then ultimately derive:
>
|- (λx.x x)(λx.x x): A
>
As in Proposition 2 of Nakano's paper.
>
Julio Di Egidio schrieb:
(But I still wouldn't know how to create a cyclic term proper in Coq or in fact in any total functional language, despite the mechanism underlying conversion/definitional equality is logical unification, and we can even somewhat access it in Coq, via the definition of `eq`/reflexivity.)
>
 

Date Sujet#  Auteur
8 Jan 25 * Honoring Raymond Smullyan35Mild Shock
8 Jan 25 +* Re: Honoring Raymond Smullyan27Julio Di Egidio
8 Jan 25 i`* Re: Honoring Raymond Smullyan26Mild Shock
8 Jan 25 i +* For a 100th Time Fuck Stackexchange (Was: Honoring Raymond Smullyan)2Mild Shock
8 Jan 25 i i`- Outdated Policy Nonsense by Stackexchange Farts (Re: For a 100th Time Fuck Stackexchange)1Mild Shock
8 Jan 25 i `* Re: Honoring Raymond Smullyan23Julio Di Egidio
8 Jan 25 i  `* Re: Honoring Raymond Smullyan22Julio Di Egidio
8 Jan 25 i   +- Re: Honoring Raymond Smullyan1Mild Shock
8 Jan 25 i   +* Re: Honoring Raymond Smullyan5Julio Di Egidio
8 Jan 25 i   i`* Re: Honoring Raymond Smullyan4Mild Shock
8 Jan 25 i   i +- Re: Honoring Raymond Smullyan1Mild Shock
9 Jan 25 i   i `* Re: Honoring Raymond Smullyan2Julio Di Egidio
9 Jan 25 i   i  `- Re: Honoring Raymond Smullyan1Mild Shock
9 Jan 25 i   `* A miraculous match? (Was: Honoring Raymond Smullyan)15Julio Di Egidio
9 Jan 25 i    `* Re: A miraculous match? (Was: Honoring Raymond Smullyan)14Julio Di Egidio
9 Jan 25 i     `* How to make cyclic terms (Was: A miraculous match?)13Mild Shock
9 Jan 25 i      +* Nakano Proposition 2 in SWI-Prolog (Was: How to make cyclic terms)3Mild Shock
9 Jan 25 i      i`* Re: Nakano Proposition 2 in SWI-Prolog (Was: How to make cyclic terms)2Mild Shock
9 Jan 25 i      i `- Re: Nakano Proposition 2 in SWI-Prolog (Was: How to make cyclic terms)1Mild Shock
9 Jan 25 i      `* Re: How to make cyclic terms (Was: A miraculous match?)9Julio Di Egidio
9 Jan 25 i       `* Re: How to make cyclic terms (Was: A miraculous match?)8Mild Shock
9 Jan 25 i        `* Re: How to make cyclic terms (Was: A miraculous match?)7Mild Shock
9 Jan 25 i         +* Re: How to make cyclic terms (Was: A miraculous match?)2Mild Shock
9 Jan 25 i         i`- Re: How to make cyclic terms (Was: A miraculous match?)1Mild Shock
9 Jan 25 i         `* Re: How to make cyclic terms (Was: A miraculous match?)4Julio Di Egidio
9 Jan 25 i          +- Re: How to make cyclic terms (Was: A miraculous match?)1Mild Shock
9 Jan 25 i          `* Re: How to make cyclic terms (Was: A miraculous match?)2Mild Shock
9 Jan 25 i           `- Re: How to make cyclic terms (Was: A miraculous match?)1Mild Shock
9 Jan 25 +* RETRO Project Sebastian Borgeaud et al. - 7 Feb 2022 (Was: Honoring Raymond Smullyan)5Mild Shock
10 Jan 25 i`* Prologers are hurt the most by LLMs (Was: RETRO Project Sebastian Borgeaud et al. - 7 Feb 2022 )4Mild Shock
10 Jan 25 i `* Vectors are the new JSON (Re: Prologers are hurt the most by LLMs)3Mild Shock
10 Jan 25 i  `* XAI is over and out (Was: Vectors are the new JSON)2Mild Shock
10 Jan 25 i   `- Academia is retarded (Was: XAI is over and out)1Mild Shock
9 Jan 25 `* Simple Types cannot ban Curry Paradox? (Was: Honoring Raymond Smullyan)2Mild Shock
9 Jan 25  `- Re: Simple Types cannot ban Curry Paradox? (Was: Honoring Raymond Smullyan)1Mild Shock

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal