is there a formal algebra method to analyze programs?
        Posted  
        
            by 
                Gabriel
            
        on Programmers
        
        See other posts from Programmers
        
            or by Gabriel
        
        
        
        Published on 2012-03-20T21:22:43Z
        Indexed on 
            2012/03/20
            23:39 UTC
        
        
        Read the original article
        Hit count: 336
        
general-development
Is there a formal/academic connection between an imperative program and algebra, and if so where would I learn about it?
The example I'm thinking of is:
if(C1) { A1(); A2(); }
if(C2) { A1(); A2(); }
Represented as a sum of terms:
(C1)(A1) + (C1)(A2) + (C2)(A1) + (C2)(A2) = (C1+C2)(A1+A2) 
The idea being that manipulation could lead to programatic refactoring - "factoring" being the common concept in this example.
© Programmers or respective owner