// --- traces -------------------------------------------------------------------------------------- // builds all possible traces from first to last label // uses the modified CFG as defined by mapped_follows() .decl trace_(current_l:label, t:trace) trace_(l, cat("_", l)) :- first(l). trace_(l2, cat(t, cat("_", l2))) :- trace_(l1, t), mapped_follows(l2, l1). .decl traces(t:trace) //.output traces traces(t) :- trace_(l, t), last(l). .decl traces_count(c:number) //.output traces_count traces_count(c) :- c = count:{traces(_)}.