Skip to content

Universally quantified vars: inconsistencies and/or unexpected results #156

@MichelSc

Description

@MichelSc

I use eye version EYE v11.19.3 (2025-05-18) SWI-Prolog version 8.4.2.

I consider graph 1:

:Test1
    rdf:type :Test;
    :testVar ?a ;
    :testFormula  { ?a rdf:type :A.}.

I observe

  • 1: ?a of line 3 is different from ?a of line 4: Unexpected
  • 2: ?a of line 3 is of type log:ForAll: OK
  • 3: ?a of line 4 is of type log:ForAll: OK

I consider now graph 2:

true =>{
:Test1
    rdf:type :Test;
    :testVar ?a ;
    :testFormula  { ?a rdf:type :A.}.
}.

I observe

  • 4: ?a of line 4 is the same ?a of line 5: OK
  • 5: ?a of type log:Other: Unexpected

Q1: why is the result different from graph 1? The graph is just inferred instead of being stated!

I consider now graph 3:

:Test1
    rdf:type :Test;
    :testVarAndFormula ( ?a { ?a rdf:type :A} ).

I observe

  • 6: both ?a are the same term: OK
  • 7: ?a is of type log:ForAll: OK

Q2: why is this different from graph 1? I just put the var and the formula in a list!

I finally consider graph 4:

:Test1
    rdf:type :Test;
    :testVarAndFormula {
        :thing :testVar ?a.
        :thing :testFormula { ?a rdf:type :A}
    }.

I observe

  • 8: both ?a are the same term: OK
  • 9: ?a is of type log:ForAll: OK

In summary:

  • when my var and my formula are terms in the stated graph (graph 1), the var is not in the scope of the formula
  • when my var and my formula are terms in the inferred graph (graph 2), the var is no longer a var
  • when my var and my formula are in a list (graph 3), it works as expected
  • when my var and my formula are in a subgraph (graph 4), it works as expected

Are observations 1 and 5 expected? In my opinion, we should have consistency between graphs 1 to 4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions