/// <summary> /// Open and read a file for its input/output pairs. /// </summary> /// <param name="file">The file with the examples.</param> /// <returns>The function that transforms the inputs into the outputs.</returns> public string Synthesize(string file) { if (!file.EndsWith(".txt") || !File.Exists(file)) { throw new NotSupportedException("Synthesize: Invalid file for examples."); } IOSet iopairs = GetIOFromFile(file); Synthesize(iopairs); return("Done."); }
private void Synthesize(IOSet io) { List <ExcelFunction> functions = new FunctionScraper().Scrape(); for (int max_depth = 1; max_depth < 5; ++max_depth) { foreach (string s in Recurse(functions, io, max_depth)) { string fullFormula = "=" + s; if (CheckAllCases(io, fullFormula)) { string formula = string.Format(s, "<input>"); Console.WriteLine(formula); } } } //TODO: Ranking }
public IEnumerable <string> Execute(IOSet ios) { return(null); }