Skip to content

Commit

Permalink
improving performance of --blogic with some 15%
Browse files Browse the repository at this point in the history
  • Loading branch information
josd committed Feb 3, 2023
1 parent ae6ae7d commit 5e0bfe1
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 18 deletions.
1 change: 1 addition & 0 deletions RELEASE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
EYE release

[v2.7.2] improving performance of --blogic with some 15%
[v2.7.1] improving --restricted for graph: and log: built-ins
[v2.7.0] refactoring --blogic
[v2.6.3] fixing issues with log:rawType to succeed with https://github.com/eyereasoner/Notation3-By-Example/blob/main/log/rawType.n3
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.1
2.7.2
40 changes: 23 additions & 17 deletions eye.pl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
:- use_module(library(semweb/turtle)).
:- catch(use_module(library(http/http_open)), _, true).

version_info('EYE v2.7.1 josd').
version_info('EYE v2.7.2 josd').

license_info('MIT License

Expand Down Expand Up @@ -11509,36 +11509,42 @@
-> throw(invalid_graffiti(D, in(A)))
; true
),
length(D, E),
length(F, E),
makevars(A, B, D, F).
findall([X,_],
( member(X, D)
),
F
),
makevar(A, B, F).
makevars(A, B, Z) :-
findvars(A, C, Z),
distinct(C, D),
length(D, E),
length(F, E),
makevars(A, B, D, F).
findall([X,_],
( member(X, D)
),
F
),
makevar(A, B, F).

makevars(A, B, C, D) :-
makevar(A, B, D) :-
atomic(A),
!,
( atom(A),
nth0(E, C, A)
-> nth0(E, D, B)
member([A,B], D)
-> true
; B = A
).
makevars(A, A, _, _) :-
makevar(A, A, _) :-
var(A),
!.
makevars([], [], _, _) :-
makevar([], [], _) :-
!.
makevars([A|B], [C|D], E, F) :-
makevars(A, C, E, F),
makevars(B, D, E, F),
makevar([A|B], [C|D], F) :-
makevar(A, C, F),
makevar(B, D, F),
!.
makevars(A, B, E, F) :-
makevar(A, B, F) :-
A =.. C,
makevars(C, [Dh|Dt], E, F),
makevar(C, [Dh|Dt], F),
nonvar(Dh),
B =.. [Dh|Dt].

Expand Down
Binary file modified eye.zip
Binary file not shown.

0 comments on commit 5e0bfe1

Please sign in to comment.