Task
Solve Dinesman's multiple dwelling problem but in a way that most naturally follows the problem statement given below.

Solutions are allowed (but not required) to parse and interpret the problem text, but should remain flexible and should state what changes to the problem text are allowed. Flexibility and ease of expression are valued.

Examples may be be split into "setup", "problem statement", and "output" sections where the ease and naturalness of stating the problem and getting an answer, as well as the ease and flexibility of modifying the problem are the primary concerns.

Example output should be shown here, as well as any comments on the examples flexibility.



The problem
Baker, Cooper, Fletcher, Miller, and Smith live on different floors of an apartment house that contains only five floors.


   Baker does not live on the top floor.
   Cooper does not live on the bottom floor. 
   Fletcher does not live on either the top or the bottom floor.
   Miller lives on a higher floor than does Cooper.
   Smith does not live on a floor adjacent to Fletcher's. 
   Fletcher does not live on a floor adjacent to Cooper's.

Where does everyone live?

 
floor1 = "return baker!=cooper and baker!=fletcher and baker!=miller and  
          baker!=smith and cooper!=fletcher and cooper!=miller and 
          cooper!=smith and fletcher!=miller and fletcher!=smith and  
          miller!=smith"
floor2 = "return baker!=4"
floor3 = "return cooper!=0"
floor4 = "return fletcher!=0 and fletcher!=4"
floor5 = "return miller>cooper"
floor6 = "return fabs(smith-fletcher)!=1"
floor7 = "return fabs(fletcher-cooper)!=1"
for baker = 0 to 4
    for cooper = 0 to 4
        for fletcher = 0 to 4
            for miller = 0 to 4
                for smith = 0 to 4
                    if eval(floor2) if eval(floor3) if eval(floor5) 
                       if eval(floor4) if eval(floor6) if eval(floor7) 
                          if eval(floor1) 
                             see "baker lives on floor " + baker + nl
                             see "cooper lives on floor " + cooper + nl
                             see "fletcher lives on floor " + fletcher + nl
                             see "miller lives on floor " + miller + nl
                             see "smith lives on floor " + smith + nl ok ok ok ok ok ok ok
                next 
            next 
        next 
    next 
next 
 