public Function(FunctionDef def, FastTransducerInstance fti, Z3Provider z3p)
{
this.z3p = z3p;
this.arity = def.inputVariables.Count;
this.name = def.id.text;
this.outputSort = getSort(def.outputSort, fti);
this.inputSorts = new Dictionary<string, Sort>();
this.variableExprs = new Dictionary<string, Expr>(); //contains the terms for the variables of the function
#region Compute input and outputs sort
Sort[] inputs = new Sort[this.arity];
uint i = 0;
foreach (var va in def.inputVariables)
{
inputs[i] = getSort(va.Value, fti);
inputSorts.Add(va.Key.text, inputs[i]);
variableExprs.Add(va.Key.text, z3p.MkVar(i, inputs[i]));
i++;
}
Expr[] varExprs = variableExprs.Values.ToArray();
#endregion
this.funcDecl = z3p.MkFreshFuncDecl(this.name, inputs, this.outputSort);
var e = GenerateZ3ExprFromExpr(def.expr, fti);
this.functionDef = e.Simplify(); //z3p.MkEqForall(z3p.MkApp(funcDecl, varExprs), GenerateZ3ExprFromExpr(def.expr, fti), varExprs);
}