From 1275a4a62d1f8301ee695b78e9cafe13cca7e668 Mon Sep 17 00:00:00 2001 From: Patrick Hochstenbach Date: Sun, 28 Jul 2024 12:48:44 +0200 Subject: [PATCH] Fixing halting tests and adding a universal quantified version --- test/pure/halting.n3s | 5 +++-- test/pure/halting2_FAIL.n3s | 5 +++-- test/pure/halting3.n3s | 40 +++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 test/pure/halting3.n3s diff --git a/test/pure/halting.n3s b/test/pure/halting.n3s index c0e12ee..579876e 100644 --- a/test/pure/halting.n3s +++ b/test/pure/halting.n3s @@ -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 . }. diff --git a/test/pure/halting2_FAIL.n3s b/test/pure/halting2_FAIL.n3s index e50b202..f30974d 100644 --- a/test/pure/halting2_FAIL.n3s +++ b/test/pure/halting2_FAIL.n3s @@ -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 . }. diff --git a/test/pure/halting3.n3s b/test/pure/halting3.n3s new file mode 100644 index 0000000..a72faea --- /dev/null +++ b/test/pure/halting3.n3s @@ -0,0 +1,40 @@ +@prefix rdfs: . +@prefix log: . +@prefix : . + +: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. + } +}.