<commit_before>/* Copyright 2009-2018 EPFL, Lausanne */

package stainless
package ast

import inox.utils.Graphs._

trait CallGraph extends inox.ast.CallGraph {
  protected val trees: Trees
  import trees._

  protected class FunctionCollector extends super.FunctionCollector with TreeTraverser {
    override def traverse(pat: Pattern): Unit = pat match {
      case UnapplyPattern(_, _, id, _, _) =>
        register(id)
        super.traverse(pat)
      case _ =>
        super.traverse(pat)
    }

    override def traverse(flag: Flag): Unit = flag match {
      case IsUnapply(isEmpty, get) =>
        register(isEmpty)
        register(get)
        super.traverse(flag)
      case _ =>
        super.traverse(flag)
    }
  }

  override protected def getFunctionCollector = new FunctionCollector
}

trait DependencyGraph extends inox.ast.DependencyGraph with CallGraph {
  import trees._

  protected class SortCollector extends super.SortCollector with TreeTraverser {
    override def traverse(pat: Pattern): Unit = pat match {
      case ADTPattern(_, id, _, _) =>
        register(id)
        super.traverse(pat)
      case _ =>
        super.traverse(pat)
    }
  }

  override protected def getSortCollector = new SortCollector
}

<commit_msg>Fix error in dependency graph computation<commit_after>/* Copyright 2009-2018 EPFL, Lausanne */

package stainless
package ast

import inox.utils.Graphs._

trait CallGraph extends inox.ast.CallGraph {
  protected val trees: Trees
  import trees._

  protected class FunctionCollector extends super.FunctionCollector with TreeTraverser {
    override def traverse(pat: Pattern): Unit = pat match {
      case UnapplyPattern(_, _, id, _, _) =>
        register(id)
        super.traverse(pat)
      case _ =>
        super.traverse(pat)
    }

    override def traverse(flag: Flag): Unit = flag match {
      case IsUnapply(isEmpty, get) =>
        register(isEmpty)
        register(get)
        super.traverse(flag)
      case _ =>
        super.traverse(flag)
    }
  }

  override protected def getFunctionCollector = new FunctionCollector
}

trait DependencyGraph extends inox.ast.DependencyGraph with CallGraph {
  import trees._

  protected class SortCollector extends super.SortCollector with TreeTraverser {
    override def traverse(pat: Pattern): Unit = pat match {
      case ADTPattern(_, id, _, _) =>
        register(symbols.getConstructor(id).sort)
        super.traverse(pat)
      case _ =>
        super.traverse(pat)
    }
  }

  override protected def getSortCollector = new SortCollector
}


{'fraction_non_alphanumeric': 0.08258667705492793, 'fraction_numerical': 0.0062329567588624854, 'mean_word_length': 2.962962962962963, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6879935', 'n_tokens_mistral': 758, 'n_tokens_neox': 724, 'n_words': 201}