Skip to content

Commit

Permalink
a blogic query is a lingua:onQuestionSurface with an optional nested …
Browse files Browse the repository at this point in the history
…lingua:onAnswerSurface
  • Loading branch information
josd committed Mar 18, 2024
1 parent e6dbd82 commit edc630d
Show file tree
Hide file tree
Showing 12 changed files with 111 additions and 15 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.3
0.6.0
2 changes: 1 addition & 1 deletion lingua/beetle.trig
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ _:ns7 {


# query
(_:S _:O) lingua:onQuerySurface _:qs.
(_:S _:O) lingua:onQuestionSurface _:qs.

_:qs {
_:S :is _:O.
Expand Down
2 changes: 1 addition & 1 deletion lingua/blogic.trig
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ _:ns2 {
}

# query
(_:S _:C) lingua:onQuerySurface _:qs.
(_:S _:C) lingua:onQuestionSurface _:qs.

_:qs {
_:S a _:C.
Expand Down
2 changes: 1 addition & 1 deletion lingua/edt.trig
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ _:nt {
}

# query
() lingua:onQuerySurface _:qs.
() lingua:onQuestionSurface _:qs.

_:qs {
edt:i100000 a edt:N100000.
Expand Down
3 changes: 3 additions & 0 deletions lingua/output/reset.trig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@prefix : <https://eyereasoner.github.io/see-lingua/lingua/reset.trig#>.

:n1 :p1 :n2.
3 changes: 3 additions & 0 deletions lingua/output/slide33.trig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@prefix : <https://eyereasoner.github.io/see-lingua/lingua/slide33.trig#>.

:xxx a :aaa.
2 changes: 1 addition & 1 deletion lingua/rain.trig
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ _:ns4 {
}

# query
(_:S _:O) lingua:onQuerySurface _:qs.
(_:S _:O) lingua:onQuestionSurface _:qs.

_:qs {
_:S :ascribed _:O.
Expand Down
17 changes: 17 additions & 0 deletions lingua/reset.trig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@prefix lingua: <http://www.w3.org/2000/10/swap/lingua#>.
@prefix : <#>.

# Reset Policy : reset all triples from the resultSurface back to the main surface

() lingua:onResultSurface _:rs.

_:rs {
:n1 :p1 :n2.
}

(_:S) lingua:onQuestionSurface _:qs.

_:qs {
() lingua:onResultSurface _:S.
() lingua:onAnswerSurface _:S.
}
2 changes: 1 addition & 1 deletion lingua/slide32.trig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ _:ns2 {
}

# query
(_:S _:C) lingua:onQuerySurface _:qs.
(_:S _:C) lingua:onQuestionSurface _:qs.

_:qs {
_:S a _:C.
Expand Down
75 changes: 75 additions & 0 deletions lingua/slide33.trig
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix lingua: <http://www.w3.org/2000/10/swap/lingua#>.
@prefix skolem: <http://eyereasoner.github.io/.well-known/genid/8b98b360-9a70-4845-b52c-c675af60ad01#>.
@prefix : <#>.

# slide 33 example from https://www.slideshare.net/PatHayes/blogic-iswc-2009-invited-talk

# owl restriction
:aaa owl:onProperty :bbb.
:aaa owl:allValuesFrom :ccc.

# the following 2 triples should entail :yyy a :ccc.
#:xxx a :aaa.
#:xxx :bbb :yyy.

# the following codex should entail :xxx a :aaa.
(_:y) lingua:onNegativeSurface _:ns1.

_:ns1 {
:xxx :bbb _:y.
() lingua:onNegativeSurface _:ns2.
}

_:ns2 {
_:y a :ccc.
}

# owl:allValuseFrom description logic
(_:a skolem:b _:c) lingua:onNegativeSurface _:ns3.

_:ns3 {
_:a owl:onProperty skolem:b.
_:a owl:allValuesFrom _:c.
() lingua:onNegativeSurface _:ns4.
}

_:ns4 {
(_:x _:y) lingua:onNegativeSurface _:ns5.
(_:x) lingua:onNegativeSurface _:ns7.
}

_:ns5 {
_:x a _:a.
_:x skolem:b _:y.
() lingua:onNegativeSurface _:ns6.
}

_:ns6 {
_:y a _:c.
}

_:ns7 {
(_:y) lingua:onNegativeSurface _:ns8.
() lingua:onNegativeSurface _:ns10.
}

_:ns8 {
_:x skolem:b _:y.
() lingua:onNegativeSurface _:ns9.
}

_:ns9 {
_:y a _:c.
}

_:ns10 {
_:x a _:a.
}

# query
(_:S _:C) lingua:onQuestionSurface _:qs.

_:qs {
_:S a _:C.
}
16 changes: 7 additions & 9 deletions see.pl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
:- use_module(library(semweb/turtle)).
:- catch(use_module(library(http/http_open)), _, true).

version_info('SEE v0.5.3 (2024-03-18)').
version_info('SEE v0.6.0 (2024-03-18)').

help_info('Usage: see <options>* <data>*

Expand Down Expand Up @@ -79,7 +79,6 @@
:- dynamic('<http://www.w3.org/2000/10/swap/lingua#headback>'/2).
:- dynamic('<http://www.w3.org/2000/10/swap/lingua#onNegativeSurface>'/2).
:- dynamic('<http://www.w3.org/2000/10/swap/lingua#onPositiveSurface>'/2).
:- dynamic('<http://www.w3.org/2000/10/swap/lingua#onQuerySurface>'/2).
:- dynamic('<http://www.w3.org/2000/10/swap/lingua#onQuestionSurface>'/2).
:- dynamic('<http://www.w3.org/2000/10/swap/lingua#premise>'/2).
:- dynamic('<http://www.w3.org/2000/10/swap/lingua#question>'/2).
Expand Down Expand Up @@ -524,17 +523,16 @@
retractall(brake)
; true
)), true)),
% convert query surface
% convert question surface
assertz(implies((
'<http://www.w3.org/2000/10/swap/lingua#onQuerySurface>'(V, G),
'<http://www.w3.org/2000/10/swap/lingua#onQuestionSurface>'(V, G),
conj_list(G, L),
append(L, ['<http://www.w3.org/2000/10/swap/lingua#onAnswerSurface>'([], G)], M),
( \+member('<http://www.w3.org/2000/10/swap/lingua#onAnswerSurface>'(_, _), L)
-> append(L, ['<http://www.w3.org/2000/10/swap/lingua#onAnswerSurface>'([], G)], M)
; M = L
),
conj_list(H, M)
), '<http://www.w3.org/2000/10/swap/lingua#onNegativeSurface>'(V, H))),
% convert question surface
assertz(implies((
'<http://www.w3.org/2000/10/swap/lingua#onQuestionSurface>'(V, G)
), '<http://www.w3.org/2000/10/swap/lingua#onNegativeSurface>'(V, G))),
% blow inference fuse
assertz(implies((
'<http://www.w3.org/2000/10/swap/lingua#onNegativeSurface>'(V, G),
Expand Down
Binary file modified see.pvm
Binary file not shown.

0 comments on commit edc630d

Please sign in to comment.