code: def all_state_variables_written(self):
          
          if self._all_state_variables_written is None:
              self._all_state_variables_written = self._explore_functions(
                  lambda x: x.state_variables_written)
          return self._all_state_variables_written
docs: recursive version of variables_written