001 // Circular attributes. 002 // See section 5.2 in the paper. 003 // Reference manual: http://jastadd.org/ 004 005 import java.util.*; 006 aspect Reachability{ 007 syn Set<State> State.reachable() circular [new HashSet<State>()]; // R1 008 009 eq State.reachable() { // R2 010 HashSet<State> result = new HashSet<State>(); 011 for (State s : successors()) { 012 result.add(s); 013 result.addAll(s.reachable()); 014 } 015 return result; 016 } 017 }