Fault-tolerance is often formalized in terms of systems adapting their behavior to their eventually stable environment. Anticipatory systems are based on predictive models of their environment. Learning provides the higher-order dynamics leading to "good" models. Using anticipation, we extend adaptive programming concepts to stronger forms of interactions with the environment leading, among others, to fault-containment. Inference rules and composition laws are given, defining how anticipation propagates from individual systems to concurrent ones.