Currently, D-FLAT supplies the whole instance to the ASP encoding at each tree decomposition node. Maybe it makes sense to only give those facts as input that are relevant for the bags of the current node or its children. Theoretically, with the current practice we have (at least) linear runtime in each call since the input has linear size. For bounded width, we could bring this down to constant time by restricting the input. However, appropriate data structures would be required, because just running through the entire input (hyper)graph before each ASP call, in order to filter the input, would yield linear runtime yet again -- albeit not inside the ASP call, but still...