diff --git a/smop/rules.pl b/smop/rules.pl index 15b83ead..4970acdf 100644 --- a/smop/rules.pl +++ b/smop/rules.pl @@ -1,13 +1,3 @@ -%:- op(800, yfx, =>). -%:- dynamic =>/2. - -%N => 0 :- number(N). -%X => 1. - -%X*X**0 => X. -%X**1 => X. -%X*X*.*Y => X**(Y+1). - prog([ nBlocks = matlab_max(matlab_ravel(ai)), [m,n] = matlab_size(ai), @@ -23,27 +13,6 @@ rewrite([M,N] = matlab_size(A), [M = fortran_size(A,1), N = fortran_size(A,2)]). -/* -len(A,1) :- atomic(A). -len(-A,K):- len(A,N), K is N+1. -len(A+B,K) :- len(A,M),len(B,N),K is M+N+1. -len(A-B,K) :- len(A,M),len(B,N),K is M+N+1. - -A+0 => A. -0+A => A. -A-0 => A. -0-A => -A. -%- -A => A. :- len(A,N), writeln(N). - -0 => 0. - A-A => 0. --A+A => 0. -%A+B => C+D :- A => C, B => D. -%A-B => C-D :- A => C, B => D. - -% example - -%sin(T)**2+cos(T)**2 => 1. -*/ rewrite(A,A) :- atomic(A),!. rewrite([A|B],[C|D]) :-