     }
   }
 
+  /// The free variables occurring in this term.
   var variables: Set<String> {
     switch self {
     case .var(let x):

public enum Term {

  case `var`(String)
  case val(AnyHashable)
  indirect case _term(name: String, arguments: [Term])
  indirect case _rule(name: String, arguments: [Term], body: Term)

  indirect case conjunction(Term, Term)
  indirect case disjunction(Term, Term)

  var dnf: Term {
    switch self {
    case .conjunction(let a, .disjunction(let b, let c)):

    }
  }

  /// Returns an alpha-equivalent term in which all given variables have been renamed.
  func renaming(_ variables: Set<String>) -> Term {
    switch self {
    case .var(let x) where variables.contains(x):
