• Self-evidently I am not my grandpa

    From Mild Shock@21:1/5 to All on Sat Apr 27 14:43:12 2024
    Lets take this "truth":

    Quine explains, “No bachelor is married,” where
    the meaning of the word ‘bachelor’ is synonymous
    with the meaning of the word ‘unmarried.’ However,
    we can make this kind of analytic claim into a
    logical truth (as defined above) by replacing
    ‘bachelor’ with its synonym, that is, ‘unmarried man,’
    to get “No unmarried man is married,” which is an
    instance of No not-X is X.

    Then examine this "truth":

    Lets say you build a Prolog family database and
    make definitions for father, grand-father etc..
    Will this Prolog family database exclude:

    "Im my own grandpa"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Barb Knox@21:1/5 to Mild Shock on Mon Apr 29 20:39:30 2024
    On 27/04/2024 16:43, Mild Shock wrote:
    Lets take this "truth":

    Quine explains, “No bachelor is married,” where
    the meaning of the word ‘bachelor’ is synonymous
    with the meaning of the word ‘unmarried.’ However,
    we can make this kind of analytic claim into a
    logical truth (as defined above) by replacing
    ‘bachelor’ with its synonym, that is, ‘unmarried man,’
    to get “No unmarried man is married,” which is an
    instance of No not-X is X.

    Then examine this "truth":

    Lets say you build a Prolog family database and
    make definitions for father, grand-father etc..
    Will this Prolog family database exclude:

    "Im my own grandpa"

    If you want it to. The additional rule needed is that X can not be an
    ancestor of X.

    --
    ---------------------------
    | BBB b \ Barbara at LivingHistory stop co stop uk
    | B B aa rrr b |
    | BBB a a r bbb | Quidquid latine dictum sit,
    | B B a a r b b | altum videtur.
    | BBB aa a r bbb |
    -----------------------------

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mild Shock@21:1/5 to Barb Knox on Mon Apr 29 21:25:22 2024
    Well I forgot to say, that only first order
    logic with equality, FOL=, is available.

    How would you define ancestor?

    Barb Knox schrieb:
    On 27/04/2024 16:43, Mild Shock wrote:
    Lets take this "truth":

    Quine explains, “No bachelor is married,” where
    the meaning of the word ‘bachelor’ is synonymous
    with the meaning of the word ‘unmarried.’ However,
    we can make this kind of analytic claim into a
    logical truth (as defined above) by replacing
    ‘bachelor’ with its synonym, that is, ‘unmarried man,’
    to get “No unmarried man is married,” which is an
    instance of No not-X is X.

    Then examine this "truth":

    Lets say you build a Prolog family database and
    make definitions for father, grand-father etc..
    Will this Prolog family database exclude:

    "Im my own grandpa"

    If you want it to.  The additional rule needed is that X can not be an ancestor of X.

    --
    ---------------------------
    |  BBB                b    \   Barbara at LivingHistory stop co stop uk
    |  B  B   aa     rrr  b     |
    |  BBB   a  a   r     bbb   |  Quidquid latine dictum sit,
    |  B  B  a  a   r     b  b  |  altum videtur.
    |  BBB    aa a  r     bbb   |
    -----------------------------


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mild Shock@21:1/5 to Mild Shock on Mon Apr 29 22:16:31 2024
    As expected, if I only use this Prolog:

    grand_father(X,Y) :- father(X,Z), father(Z,Y).

    Applying Clark Completion gets me this closed formula:

    ∀X∀Y(∃Z(father(X,Z) & father(Z,Y)) <=> grand_father(X,Y)).

    Asking for counter models to ~ "Im my own grandpa" entailment:

    % ?- problem(1, F), counter(F, M).
    % M = [father(0, 0)-1, grand_father(0, 0)-1]
    % Etc..
    % M = [father(1, 1)-0, father(1, 0)-1, father(0, 1)-1,
    % grand_father(1, 1)-1, father(0, 0)-0, grand_father(1, 0)-0,
    % grand_father(0, 1)-0, grand_father(0, 0)-1]
    % Etc..

    The first solution, is from a domain with size N=1,
    and it basically says a counter model is when
    there is an individual 0, which is its own father.

    The second solution, is from a domain with size N=2,
    and it basically says a counter model is when
    there are two individuals 0 and 1, which are each others father.

    Etc..

    Source code:

    % problem(+Integer, -Formula)
    problem(1, (
    ![X]:![Y]:(?[Z]:(father(X,Z) & father(Z,Y)) <=> grand_father(X,Y)) =>
    ~ ?[X]:grand_father(X,X))).

    % counter(+Formula, -Model)
    counter(F, M) :-
    between(1, 3, N),
    expand(F, N, G),
    quine(G, M, V),
    V = 0.

    Plus expand/3 and quine/3 are found here: https://swi-prolog.discourse.group/t/7398

    Mild Shock schrieb:

    Well I forgot to say, that only first order
    logic with equality, FOL=, is available.

    How would you define ancestor?

    Barb Knox schrieb:
    On 27/04/2024 16:43, Mild Shock wrote:
    Lets take this "truth":

    Quine explains, “No bachelor is married,” where
    the meaning of the word ‘bachelor’ is synonymous
    with the meaning of the word ‘unmarried.’ However,
    we can make this kind of analytic claim into a
    logical truth (as defined above) by replacing
    ‘bachelor’ with its synonym, that is, ‘unmarried man,’
    to get “No unmarried man is married,” which is an
    instance of No not-X is X.

    Then examine this "truth":

    Lets say you build a Prolog family database and
    make definitions for father, grand-father etc..
    Will this Prolog family database exclude:

    "Im my own grandpa"

    If you want it to.  The additional rule needed is that X can not be an
    ancestor of X.

    --
    ---------------------------
    |  BBB                b    \   Barbara at LivingHistory stop co stop uk
    |  B  B   aa     rrr  b     |
    |  BBB   a  a   r     bbb   |  Quidquid latine dictum sit,
    |  B  B  a  a   r     b  b  |  altum videtur.
    |  BBB    aa a  r     bbb   |
    -----------------------------



    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Barb Knox@21:1/5 to Mild Shock on Tue Apr 30 09:25:07 2024
    On 29/04/2024 23:25, Mild Shock wrote:

    Well I forgot to say, that only first order
    logic with equality, FOL=, is available.

    It's not clear to me whether you are asking about FOL=, or Prolog. (You
    do know that they are not the same, right?)

    How would you define ancestor?

    The usual way.

    This is beginning to smell a lot like homework.

    Maybe you should take this to comp.lang.prolog (where they also resist
    doing people's homework for them, but maybe someone's sense of smell is
    less acute then mine).


    Barb Knox schrieb:
    On 27/04/2024 16:43, Mild Shock wrote:
    Lets take this "truth":

    Quine explains, “No bachelor is married,” where
    the meaning of the word ‘bachelor’ is synonymous
    with the meaning of the word ‘unmarried.’ However,
    we can make this kind of analytic claim into a
    logical truth (as defined above) by replacing
    ‘bachelor’ with its synonym, that is, ‘unmarried man,’
    to get “No unmarried man is married,” which is an
    instance of No not-X is X.

    Then examine this "truth":

    Lets say you build a Prolog family database and
    make definitions for father, grand-father etc..
    Will this Prolog family database exclude:

    "Im my own grandpa"

    If you want it to.  The additional rule needed is that X can not be an
    ancestor of X.
    --
    ---------------------------
    | BBB b \ Barbara at LivingHistory stop co stop uk
    | B B aa rrr b |
    | BBB a a r bbb | Quidquid latine dictum sit,
    | B B a a r b b | altum videtur.
    | BBB aa a r bbb |
    -----------------------------

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeff Barnett@21:1/5 to All on Mon Apr 29 22:50:15 2024
    T24gNC8yOS8yMDI0IDU6MjUgQU0sIE1pbGQgU2hvY2sgd3JvdGU6DQo+IA0KPiBXZWxsIEkg Zm9yZ290IHRvIHNheSwgdGhhdCBvbmx5IGZpcnN0IG9yZGVyDQo+IGxvZ2ljIHdpdGggZXF1 YWxpdHksIEZPTD0sIGlzIGF2YWlsYWJsZS4NCg0KWW91IGFsc28gZm9yZ290IHRoYXQgeW91 IHBvc2VkIHRoaXMgYXMgYSBQcm9sb2csIG5vdCBhbiBGT0wsIHByb2JsZW0uDQoNCj4gSG93 IHdvdWxkIHlvdSBkZWZpbmUgYW5jZXN0b3I/DQo+IA0KPiBCYXJiIEtub3ggc2NocmllYjoN Cj4+IE9uIDI3LzA0LzIwMjQgMTY6NDMsIE1pbGQgU2hvY2sgd3JvdGU6DQo+Pj4gTGV0cyB0 YWtlIHRoaXMgInRydXRoIjoNCj4+Pg0KPj4+PiBRdWluZSBleHBsYWlucywg4oCcTm8gYmFj aGVsb3IgaXMgbWFycmllZCzigJ0gd2hlcmUgDQo+Pj4gdGhlIG1lYW5pbmcgb2YgdGhlIHdv cmQg4oCYYmFjaGVsb3LigJkgaXMgc3lub255bW91cw0KPj4+IHdpdGggdGhlIG1lYW5pbmcg b2YgdGhlIHdvcmQg4oCYdW5tYXJyaWVkLuKAmSBIb3dldmVyLA0KPj4+IHdlIGNhbiBtYWtl IHRoaXMga2luZCBvZiBhbmFseXRpYyBjbGFpbSBpbnRvIGENCj4+PiBsb2dpY2FsIHRydXRo IChhcyBkZWZpbmVkIGFib3ZlKSBieSByZXBsYWNpbmcNCj4+PiDigJhiYWNoZWxvcuKAmSB3 aXRoIGl0cyBzeW5vbnltLCB0aGF0IGlzLCDigJh1bm1hcnJpZWQgbWFuLOKAmQ0KPj4+IHRv IGdldCDigJxObyB1bm1hcnJpZWQgbWFuIGlzIG1hcnJpZWQs4oCdIHdoaWNoIGlzIGFuDQo+ Pj4gaW5zdGFuY2Ugb2YgTm8gbm90LVggaXMgWC4NCj4+Pg0KPj4+IFRoZW4gZXhhbWluZSB0 aGlzICJ0cnV0aCI6DQo+Pj4NCj4+PiBMZXRzIHNheSB5b3UgYnVpbGQgYSBQcm9sb2cgZmFt aWx5IGRhdGFiYXNlIGFuZA0KPj4+IG1ha2UgZGVmaW5pdGlvbnMgZm9yIGZhdGhlciwgZ3Jh bmQtZmF0aGVyIGV0Yy4uDQo+Pj4gV2lsbCB0aGlzIFByb2xvZyBmYW1pbHkgZGF0YWJhc2Ug ZXhjbHVkZToNCj4+Pg0KPj4+ICJJbSBteSBvd24gZ3JhbmRwYSINCj4+DQo+PiBJZiB5b3Ug d2FudCBpdCB0by7CoCBUaGUgYWRkaXRpb25hbCBydWxlIG5lZWRlZCBpcyB0aGF0IFggY2Fu IG5vdCBiZSBhbiANCj4+IGFuY2VzdG9yIG9mIFguLS0gDQpKZWZmIEJhcm5ldHQNCg0K

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mild Shock@21:1/5 to Jeff Barnett on Tue Apr 30 20:11:22 2024
    Jeff/Barb you might be highly confused! This is Prolog:

    grand_father(X,Y) :- father(X,Z), father(Z,Y).

    But this is FOL:

    ∀X∀Y(∃Z(father(X,Z) & father(Z,Y)) <=> grand_father(X,Y)).

    The manual method to go from Prolog to FOL is
    the so called Clark Completion. It was recently
    made popular again by SWI-Prolog's s(CASP),

    but the method exists already quite long:

    Logic Programming Theory Lecture 8: Clark Completion https://www.inf.ed.ac.uk/teaching/courses/lp/2012/slides/lpTheory8.pdf

    But I am using it manually as well here. You see
    the FOL formula I used as input to the model finder
    in the problem/2 fact:

    % problem(+Integer, -Formula)
    problem(1, (
    ![X]:![Y]:(?[Z]:(father(X,Z) & father(Z,Y)) <=> grand_father(X,Y)) =>
    ~ ?[X]:grand_father(X,X))).

    Jeff Barnett schrieb:
    You also forgot that you posed this as a Prolog, not an FOL, problem.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mild Shock@21:1/5 to Barb Knox on Tue Apr 30 20:04:10 2024
    Its only work if you don't like it, otherwise
    its pure logic programming joy. I didn't have
    time to try an ancestor formalization yet.

    Yes the requirememt is FOL, from the SWI-Prolog
    thread one can extract that I am using the
    Vidal-Rosset Variant of the Otten Prover Syntax:

    :- op( 500, fy, ~). % negation
    :- op(1000, xfy, &). % conjunction
    :- op(1100, xfy, '|'). % disjunction
    :- op(1110, xfy, =>). % conditional
    :- op(1120, xfy, <=>). % biconditional
    :- op( 500, fy, !). % universal quantifier: ![X]:
    :- op( 500, fy, ?). % existential quantifier: ?[X]:
    :- op( 500,xfy, :).

    Thats the Operator definitions in Prolog
    to feed the Otten Prover with FOL formulas.
    I use the same Operators to feed my model

    finder with FOL formulas. Now I have rewritten
    the model finder to give a better output:

    ?- counter(1).
    father(0,0)-1
    grand_father(0,0)-1
    true ;
    [...]
    father(0,0)-0
    father(0,1)-1
    father(1,0)-1
    father(1,1)-0
    grand_father(0,0)-1
    grand_father(0,1)-0
    grand_father(1,0)-0
    grand_father(1,1)-1
    true

    This is the cosmetic makeover of the model finder:

    % problem(+Integer, -Formula)
    problem(1, (
    ![X]:![Y]:(?[Z]:(father(X,Z) & father(Z,Y)) <=> grand_father(X,Y)) =>
    ~ ?[X]:grand_father(X,X))).

    % counter(+Integer)
    counter(K) :-
    problem(K, F),
    between(1, 3, N),
    expand(F, N, G),
    quine(G, M, V),
    V = 0,
    keysort(M, L),
    (member(X, L), write(X), nl, fail; true).

    Plus expand/3 and quine/3 are found here: https://swi-prolog.discourse.group/t/7398

    Barb Knox schrieb:
    This is beginning to smell a lot like homework.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mild Shock@21:1/5 to Mild Shock on Thu May 2 10:34:17 2024
    Hi,

    A full version that has operator definitions
    that also work for Scryer Prolog and that uses a
    Quine algorithm that even supports function

    symbols like in Mace4 by McCune, is found
    here on SWI-Prolog SWISH:

    McCunes Mace4 Model Finder
    https://swish.swi-prolog.org/p/mace4.swinb

    Have Fun!

    Mild Shock schrieb:
    Its only work if you don't like it, otherwise
    its pure logic programming joy. I didn't have
    time to try an ancestor formalization yet.

    Yes the requirememt is FOL, from the SWI-Prolog
    thread one can extract that I am using the
    Vidal-Rosset Variant of the Otten Prover Syntax:

    :- op( 500, fy, ~).     % negation
    :- op(1000, xfy, &).    % conjunction
    :- op(1100, xfy, '|').  % disjunction
    :- op(1110, xfy, =>).   % conditional
    :- op(1120, xfy, <=>).  % biconditional
    :- op( 500, fy, !).     % universal quantifier:  ![X]:
    :- op( 500, fy, ?).     % existential quantifier:  ?[X]:
    :- op( 500,xfy, :).

    Thats the Operator definitions in Prolog
    to feed the Otten Prover with FOL formulas.
    I use the same Operators to feed my model

    finder with FOL formulas. Now I have rewritten
    the model finder to give a better output:

    ?- counter(1).
    father(0,0)-1
    grand_father(0,0)-1
    true ;
    [...]
    father(0,0)-0
    father(0,1)-1
    father(1,0)-1
    father(1,1)-0
    grand_father(0,0)-1
    grand_father(0,1)-0
    grand_father(1,0)-0
    grand_father(1,1)-1
    true

    This is the cosmetic makeover of the model finder:

    % problem(+Integer, -Formula)
    problem(1, (
      ![X]:![Y]:(?[Z]:(father(X,Z) & father(Z,Y)) <=> grand_father(X,Y)) =>
      ~ ?[X]:grand_father(X,X))).

    % counter(+Integer)
    counter(K) :-
       problem(K, F),
       between(1, 3, N),
       expand(F, N, G),
       quine(G, M, V),
       V = 0,
       keysort(M, L),
       (member(X, L), write(X), nl, fail; true).

    Plus expand/3 and quine/3 are found here: https://swi-prolog.discourse.group/t/7398

    Barb Knox schrieb:
    This is beginning to smell a lot like homework.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)