Semantic foundations of program analysis