public function printVars(Func $func)
{
$rendered = $this->render($func);
$output = '';
foreach ($rendered['varIds'] as $var) {
$id = $rendered['varIds'][$var];
$output .= "\nVar#{$id}";
$output .= $this->indent("\n" . "WriteOps:");
foreach ($var->ops as $writeOp) {
if ($rendered['ops']->contains($writeOp)) {
$output .= $this->indent("\n" . $rendered['ops'][$writeOp]['label'], 2);
}
}
$output .= $this->indent("\n" . "ReadOps:");
foreach ($var->usages as $usage) {
if ($rendered['ops']->contains($usage)) {
$output .= $this->indent("\n" . $rendered['ops'][$usage]['label'], 2);
}
}
$output .= "\n";
}
return $output;
}