Skip to content

Commit

Permalink
Fixing halting tests and adding a universal quantified version
Browse files Browse the repository at this point in the history
  • Loading branch information
phochste committed Jul 28, 2024
1 parent 1470d7e commit 1275a4a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 4 deletions.
5 changes: 3 additions & 2 deletions test/pure/halting.n3s
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
:T1 a :Test .

# Generate an endless loop...
(_:A _:B) log:onNegativeSurface {
# _:B is an existential quantified variable
(_:A) log:onNegativeSurface {
_:A a :Test .

() log:onNegativeSurface {
(_:B) log:onNegativeSurface {
_:B a :Test .
_:A :child _:B .
}.
Expand Down
5 changes: 3 additions & 2 deletions test/pure/halting2_FAIL.n3s
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
:T1 a :Test .

# Generate an endless loop...
(_:A _:B) log:onNegativeSurface {
# _:B is an existential quantified variable
(_:A) log:onNegativeSurface {
_:A a :Test .

() log:onNegativeSurface {
(_:B) log:onNegativeSurface {
_:B a :Test .
_:A :child _:B .
}.
Expand Down
40 changes: 40 additions & 0 deletions test/pure/halting3.n3s
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix : <urn:example:>.

:T1 a :Test .

# Generate an endless loop...
# _:B is a universal quantifier
(_:A _:B) log:onNegativeSurface {
_:A a :Test .

() log:onNegativeSurface {
_:B a :Test .
_:A :child _:B .
}.
}.

# But provide a condition when the loop could generate a result
(_:S1 _:S2 _:S3 _:S4 _:S5 _:S6 _:S7 _:S8 _:S9) log:onNegativeSurface {
:X a :Test .
:X :child _:S1 .
_:S1 :child _:S2 .
_:S2 :child _:S3 .
_:S3 :child _:S4 .
_:S4 :child _:S5 .
_:S6 :child _:S7 .
_:S7 :child _:S8 .
_:S8 :child _:S9 .
_:S9 a :Test .
() log:onNegativeSurface {
:test :is true.
}.
}.

() log:onNegativeSurface {
:test :is true.
() log:onNegativeAnswerSurface {
:test :is true.
}
}.

0 comments on commit 1275a4a

Please sign in to comment.