parameters: (self, wff)
docstring: Test whether a given expr is entirely constant, chilled or frozen.
docstring_summary: Test whether a given expr is entirely constant, chilled or frozen.
docstring_tokens: Test whether a given expr is entirely constant chilled or frozen .
function: def eval_frozen(self, wff):
          "Test whether a given expr is entirely constant, chilled or frozen."
          if isinstance(wff,cml.trit) or type(wff) in (type(0),type(0L),type("")):
              return wff
          elif isinstance(wff, cml.ConfigSymbol):
              if wff.frozen() or self.chilled.has_key(wff):
                  return wff.eval()
              elif wff.is_derived():
                  return self.eval_frozen(wff.default)
              else:
                  return None
          elif wff[0] == 'not':
              below = self.eval_frozen(wff[1])
              if below == None:
                  return None
              else:
                  return cml.trit(not below)
          elif wff[0] == '?':
              guard = self.eval_frozen(wff[1])
              if guard == None:
                  return None
              if guard:
                  return self.eval_frozen(wff[2])
              else:
                  return self.eval_frozen(wff[3])
          else:
              left = self.eval_frozen(wff[1])
              right = self.eval_frozen(wff[2])
              if left != None and right != None:
                  return cml.evaluate((wff[0], left, right))
              elif left == None and right == None:
                  return None
              # OK, now the grotty part starts
              elif wff[0] == 'and':
                  if left == cml.n or right == cml.n:
                      return cml.n
                  elif left in (cml.y, cml.m):
                      return right
                  elif right in (cml.y, cml.m):
                      return left
                  else:
                      return None
              elif wff[0] == 'or':
                  if left in (cml.y, cml.m) or right in (cml.y, cml.m):
                      return cml.y
                  elif left == cml.n:
                      return right
                  elif right == cml.n:
                      return left
                  else:
                      return None
              elif wff[0] == 'implies':
                  if left in (cml.y, cml.m):
                      return right
                  elif left == cml.n:
                      return cml.y
                  elif right == cml.n:
                      return not left
                  else:
                      return None
              else:
                  return None
function_tokens: def eval_frozen ( self , wff ) : if isinstance ( wff , cml . trit ) or type ( wff ) in ( type ( 0 ) , type ( 0L ) , type ( "" ) ) : return wff elif isinstance ( wff , cml . ConfigSymbol ) : if wff . frozen ( ) or self . chilled . has_key ( wff ) : return wff . eval ( ) elif wff . is_derived ( ) : return self . eval_frozen ( wff . default ) else : return None elif wff [ 0 ] == 'not' : below = self . eval_frozen ( wff [ 1 ] ) if below == None : return None else : return cml . trit ( not below ) elif wff [ 0 ] == '?' : guard = self . eval_frozen ( wff [ 1 ] ) if guard == None : return None if guard : return self . eval_frozen ( wff [ 2 ] ) else : return self . eval_frozen ( wff [ 3 ] ) else : left = self . eval_frozen ( wff [ 1 ] ) right = self . eval_frozen ( wff [ 2 ] ) if left != None and right != None : return cml . evaluate ( ( wff [ 0 ] , left , right ) ) elif left == None and right == None : return None # OK, now the grotty part starts elif wff [ 0 ] == 'and' : if left == cml . n or right == cml . n : return cml . n elif left in ( cml . y , cml . m ) : return right elif right in ( cml . y , cml . m ) : return left else : return None elif wff [ 0 ] == 'or' : if left in ( cml . y , cml . m ) or right in ( cml . y , cml . m ) : return cml . y elif left == cml . n : return right elif right == cml . n : return left else : return None elif wff [ 0 ] == 'implies' : if left in ( cml . y , cml . m ) : return right elif left == cml . n : return cml . y elif right == cml . n : return not left else : return None else : return None