Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0bbd0bc
Test Commit
Jan 14, 2018
3615466
Merge remote-tracking branch 'upstream/master'
tmitsi Jan 16, 2018
23a0cd3
Initial SWI Prolog Support
tmitsi Jan 17, 2018
429e09d
Update printUsage
tmitsi Jan 17, 2018
213cd9a
Preliminary support for SWI engine
tmitsi Mar 19, 2018
8733b12
Merged upstream changes and resolved conflicts
tmitsi Mar 19, 2018
e8ba818
Find Linux and Windows SWI executable
tmitsi Sep 27, 2018
e10784d
Sync with upstream
tmitsi Sep 27, 2018
9c4bbc0
Add SWI flag for ISO prolog compatibility :- set_prolog_flag(iso,true).
tmitsi Sep 27, 2018
8bf7678
Include message for SWI Prolog default path to command line help message
tmitsi Sep 27, 2018
04d4e76
New test folder for SWI Prolog containing succeeding and failing cases
tmitsi Sep 27, 2018
3980036
Find SWI executable on MacOS
tmitsi Sep 29, 2018
839a7b0
Fix test suite not exiting after tests, specific SWI version numbering
tmitsi Sep 29, 2018
c902f7a
remove set_prolog_flag(unknown,fail) for SWI Prolog
tmitsi Oct 21, 2018
22ad514
implement -b (backend) command line option for target language prolog
tmitsi Oct 31, 2018
5239f64
suppress discontiguous warnings for SWI Prolog
tmitsi Oct 31, 2018
90690ce
update working tests for SWI Prolog
tmitsi Oct 31, 2018
2ce6d44
fix numbering in SWI discontiguous declaration
tmitsi Nov 6, 2018
30824d0
merge upstream changes
tmitsi Dec 3, 2018
83834c5
delete duplicate code from last commit
tmitsi Dec 3, 2018
25aa192
modify getSystemName method for SWI Prolog
tmitsi Dec 3, 2018
2a5b800
add error message for unsupported backend
tmitsi Dec 3, 2018
79c29df
update pom files for 1.4 with SWI Prolog support
tmitsi Dec 3, 2018
ec5bc8b
add /usr/local/bin/swipl as a search location for SWI binary on Linux
tmitsi Dec 10, 2018
638a51f
update --help and --longhelp command line options
tmitsi Dec 10, 2018
715bdfe
clean SWIEngine.java and remove ^M characters
tmitsi Dec 10, 2018
e8e9203
replace return statement with System.exit(0) after testsuite completion
tmitsi Dec 10, 2018
f469d06
move testsynsem-SWI-Prolog_tests to SWI-Prolog-tests
tmitsi Dec 11, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions PSOA2X/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.ruleml.psoa</groupId>
<artifactId>PSOA2X</artifactId>
<version>1.3</version>
<version>1.4</version>
<name>PSOA2X</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -84,7 +84,7 @@
<dependency>
<groupId>org.ruleml.psoa</groupId>
<artifactId>PSOACore</artifactId>
<version>1.3</version>
<version>1.4</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public abstract class AbstractPrologConverter extends PrologTermLangConverter {
{
// Taken from W3C RIF-DTB library
s_builtInMap.put("http://www.w3.org/2007/rif-builtin-predicate#numeric-equal", "\'=:=\'");
s_builtInMap.put("http://www.w3.org/2007/rif-builtin-predicate#numeric-not-equal", "\'=\\=\'");
s_builtInMap.put("http://www.w3.org/2007/rif-builtin-predicate#numeric-not-equal", "\'=\\\\=\'");
s_builtInMap.put("http://www.w3.org/2007/rif-builtin-predicate#numeric-greater-than", "\'>\'");
s_builtInMap.put("http://www.w3.org/2007/rif-builtin-predicate#numeric-greater-than-or-equal", "\'>=\'");
s_builtInMap.put("http://www.w3.org/2007/rif-builtin-predicate#numeric-less-than", "\'<\'");
Expand Down Expand Up @@ -58,12 +58,12 @@ public abstract class AbstractPrologConverter extends PrologTermLangConverter {
s_builtInMap.put("https://www.iso.org/standard/21413.html#exp", "exp");
s_builtInMap.put("https://www.iso.org/standard/21413.html#log", "log");

// Predicates
// Predicates
s_builtInMap.put("https://www.iso.org/standard/21413.html#integer", "integer"); // Test if integer
s_builtInMap.put("https://www.iso.org/standard/21413.html#float", "float"); // Test if shortcut or xs:double float number (represented as double) [Currently redundant because of above same-named coerce]
s_builtInMap.put("https://www.iso.org/standard/21413.html#number", "number"); // Test if number
s_builtInMap.put("https://www.iso.org/standard/21413.html#eq", "\'=:=\'"); // XSB's special character tokens ...
s_builtInMap.put("https://www.iso.org/standard/21413.html#not_eq", "\'=\\=\'"); //
s_builtInMap.put("https://www.iso.org/standard/21413.html#not_eq", "\'=\\\\=\'"); //
s_builtInMap.put("https://www.iso.org/standard/21413.html#greater_than", "\'>\'"); //
s_builtInMap.put("https://www.iso.org/standard/21413.html#greater_than_or_eq", "\'>=\'"); //
s_builtInMap.put("https://www.iso.org/standard/21413.html#less_than", "\'<\'"); //
Expand Down
2 changes: 1 addition & 1 deletion PSOACore/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.ruleml.psoa</groupId>
<artifactId>PSOACore</artifactId>
<version>1.3</version>
<version>1.4</version>
<name>PSOACore</name>
<build>
<defaultGoal>install</defaultGoal>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
RuleML(
Assert(
% atomic-formula expressivity
% 2 relationships
% single tuple
% dependent tuple
% implicit tuple
% 1 element
% constant elements
p(a)
p(b)
% '_p'('_a').
% '_p'('_b').
) )
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
?x=_a
?x=_b
?x=_c
?x=_d
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
p(?x)
% '_p'(Qx).
% Correctness Criterion: query for the an implicit atom with query variable matching
% both of two implicit atoms in a KB answers with both bindings.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
RuleML(
Assert(
% atomic-formula expressivity
% pn1 (perspeneutral)
% single tuple
% independent tuple
% 3 elements
% constant elements
p(-[a b c])
% tupterm('_1','_a','_b','_c').
% memterm('_1','_p').
) )
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
?x=_a
?x=_b
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
?x=_a ?y=_b ?z=_c
?x=_c ?y=_b ?z=_a
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
?x=_1
?x=_2
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
p(-[?x b c])
% (tupterm(Q1,Qx,'_b','_c'),memterm(Q1,'_p')).
% Correctness Criterion: Query for non-ground atom with independent single tuple of
% one variable and two constant arguments
% against KB containing a matching ground atom answers with appropriate substitution.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
p(-[?x ?y ?z])
% (tupterm(Q1,Qx,Qy,Qz),memterm(Q1,'_p')).
% Correctness Criterion: Query for non-ground atom with independent single tuple of
% three variable arguments
% against KB containing a matching ground atom answers with appropriate substitution.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
?x#Top(-[a b c])
% tupterm(Qx,'_a','_b','_c').
% Correctness Criterion: Query for ground atom with Top independent single tuple of three constant arguments
% and masked oid variable
% against KB containing only the independent version of that ground atom with
% specific predicate answers "Yes".
37 changes: 37 additions & 0 deletions PSOATransRun/SWI-Prolog-tests/SWI-compatible/test/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
The directory stores a test suite used for the automated testing of
PSOA implementations, e.g. by our Java-based PSOATransRun
testing module.

The testing module expects the following naming conventions:
Each test case is stored under one
subdirectory, which we will call <testCaseName>.
Under this subdirectory, there exists
one main KB file <testCaseName>-KB.psoa,
zero or more imported KB files, e.g. written as
<testCaseName>-KB-importedI.psoa, I=1,2,... (the testing
module will ignore all files whose names contain anything
between "KB" and ".psoa"),
one or more query files <testCaseName>-queryJ.psoa, J=1,2,..., and
one answer file <testCaseName>-answerJ.psoa for each query <testCaseName>-queryJ.psoa.

A query/answer pair of files (-queryJ/-answerJ) is called a "unit test".

Query and answer files should be authored such that answer bindings
use only constants drawn from the KB ("certain answers") instead of
system-generated ones (e.g., _oidcons, Skolem functions), which can
vary under different command-line options and implementations.

An Eclipse Run configuration may be used to automate the test execution as follows:
Run Configurations
Main
Project: PSOATransRun
Main class: org.ruleml.psoa.psoatransrun.PSOATransRunCmdLine
Arguments
Program Arguments: --test -i ...\git\PSOATransRunComponents\PSOATransRun\test
OR
Program Arguments: --test -s -i ...\git\PSOATransRunComponents\PSOATransRun\test

The following command is used to manually execute
<testCaseName>-queryJ.psoa on <testCaseName>-KB.psoa
(the answers will go to the standard output):
java -jar PSOATransRunLocal.jar -i <testCaseName>-KB.psoa -q <testCaseName>-queryJ.psoa
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Document(
Group (
_a2#_betweenObjRel(_canada _usa _mexico _dim->2 _orient->_northSouth)
)
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
no
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
no
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
no
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
no
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
no
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
?X=_canada
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
?X=_canada ?Z=_mexico
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
no
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
?V=_northSouth
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
?U=2 ?V=_northSouth
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
no
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
?V=_northSouth
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
?S=_dim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
?S=_dim ?T=_orient
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
no
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
no
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
?I=_a2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
?I=_a2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel([_canada _usa _mexico] _dim->2 _orient->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(_orient->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(_usa _canada _mexico _dim->2 _orient->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(_canada _usa _mexico _dim->3 _orient->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(_canada _usa _mexico _dim->2 _orient->_northSouth _start->1867)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel([_canada _usa _mexico] [_estonia _latvia _lithuania] _dim->2 _orient->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a1#_betweenObjRel(_canada _usa _mexico _dim->2 _orient->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(_canada _usa _mexico _dim->2 _orient->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_betweenObjRel(_canada _usa _mexico _dim->2 _orient->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(?X _usa _mexico _dim->2 _orient->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(?X _usa ?Z _dim->2 _orient->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(?X _usa ?X _dim->2 _orient->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(_canada _usa _mexico _dim->2 _orient->?V)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(_canada _usa _mexico _dim->?U _orient->?V)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(_canada _usa _mexico _dim->?U _orient->?U)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(_canada _usa _mexico _orient->?V)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(_canada _usa _mexico ?S->2 _orient->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(_canada _usa _mexico ?S->2 ?T->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(_alaska _usa _mexico _dim->2 _orient->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(_canada _usa _mexico ?S->2 ?S->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
?I#_betweenObjRel(_canada _usa _mexico _dim->2 _orient->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
?I#_betweenObjRel(_canada _usa _mexico)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(_canada _usa _mexico _orient->_northSouth _dim->2)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(_canada _usa _mexico _dim->2 _orient->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(_canada _usa _mexico _dim->2 _orient->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(_canada _usa _mexico _orient->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(_canada _usa _mexico)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(_dim->2 _orient->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Document
(
Group
(
Forall ?M (
Exists ?O ( ?O#_betweenObjRel(_northPole ?M _southPole _dim->2 _orient->_northSouth) )
)
)
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
no
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
no
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
?X=_northPole
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
?X=_northPole ?Z=_southPole
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
no
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a2#_betweenObjRel(_northPole _usa _southPole _dim->2 _orient->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
?#_betweenObjRel(_northPole _usa _southPole _dim->2 _orient->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
?#_betweenObjRel(_northPole _usa _southPole)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_a1#_betweenObjRel(_northPole _usa _southPole _dim->2 _orient->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Exists ?O (?O#_betweenObjRel(_northPole _usa _southPole _dim->2 _orient->_northSouth))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Exists ?O (?O#_betweenObjRel(_northPole _eu _southPole _dim->2 _orient->_northSouth))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_betweenObjRel(_northPole _usa _southPole _dim->2 _orient->_northSouth)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Exists ?O (?O#_betweenObjRel(?X _usa _southPole _dim->2 _orient->_northSouth))
Loading