Skip to content

Commit

Permalink
works
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlei committed Jan 24, 2017
1 parent d2ef186 commit ba1f510
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions smop/rules.pl
Original file line number Diff line number Diff line change
@@ -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),
Expand All @@ -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]) :-
Expand Down

0 comments on commit ba1f510

Please sign in to comment.