Start using constraints for decoding net predicates
authorDaniel Schwyn <danielschwyn@gmail.com>
Fri, 19 May 2017 15:32:09 +0000 (17:32 +0200)
committerDaniel Schwyn <schwyda@student.ethz.ch>
Tue, 13 Jun 2017 12:21:35 +0000 (14:21 +0200)
Signed-off-by: Daniel Schwyn <schwyda@student.ethz.ch>

tools/sockeye2/decodingNet.pl

index 61afaa2..524e696 100644 (file)
@@ -8,10 +8,13 @@
 % Attn: Systems Group.
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-:- module(decodingNet,[resolve/2]).
+%% :- module(decodingNet,[resolve/2]).
+
+:- lib(ic).
 
 blockContains(block(Base, Limit),Addr) :-
-    between(Base,Limit,Addr).
+    %% between(Base,Limit,Addr).
+    Addr :: Base .. Limit.
 
 blockListContains([B|Blocks],Addr) :-
     blockContains(B,Addr);
@@ -21,7 +24,7 @@ mapsToName(map(SrcBlock,Dest,DestBase),Addr,Name) :-
     name(Dest,DestAddr) = Name,
     blockContains(SrcBlock,Addr),
     block(SrcBase,_) = SrcBlock,
-    DestAddr is Addr - SrcBase + DestBase.
+    DestAddr #= Addr - SrcBase + DestBase.
 
 listMapsToName([M|Maps],Addr,Name) :-
     mapsToName(M,Addr,Name);