Skip to content

What We Have So Far

Felix Sosa edited this page Feb 7, 2019 · 6 revisions

As per our meeting on 02/04/18, we believe the best way to work is through formalized notions of Domains and Solvers. These are abstract base classes for any domain or solver we might implement to promote compatibility between arbitrary solvers and domains.

Domains consist of:

  • DSLs: {Class1, ..., ClassN}

    • A DSL consists of a set of classes:
      DSL = {Add, Substract, Transpose, ...}
      Where Add, Subtract, and Transpose are all defined Python classes as described below.
  • Class: {Signature, Func(LHS, RHS), Token}

    • A class within a DSL will consist of a signature (its name), a function, and a token that is able to be parsed:
      class Plus:
      # The class name is the signature
        def __init__(self):
          # The token
          self.token = '+'
        def __repr__(self):
          return self.token
        def f(LHS,RHS):
          # The function
          return LHS + RHS 
  • Execute: Prog -> Spec

    • Execute(Prog, Spec) will take both a Program and a Spec and execute a Solver to solve the Domain
  • Context: Spec* -> Ctx

    • A Context takes a Spec* and outputs a Ctx
  • Loss: Spec -> Prog -> Real Number

    • Loss takes a Spec and Program and outputs a real number detailing how close the current Program and Spec are to the Spec*

Solvers consist of:

  • Solver: DSL -> Spec -> Loss -> Timeout -> [(progN, lossN, timeN)]
    • A solver will take a DSL, Spec, Loss, and a Timeout and output a list of size N of triples of Programs, Losses, and Times
    • Timeout is the maximum amount of time the solver has to solve the Spec
    • class Solver:
        def __init__(self, dsl, spec, loss, timeout):
          self.dsl = dsl
          self.spec = spec
          self.loss = loss
          self.timeout = timeout
          self.report_list = []
        def __repr__(self):
          # Each solver must have a representation (e.g. return "MCTS")
          pass
        def execute(self, program, spec):
          # Executing the solver
          pass
        def report(self):
          # Adding to report_list
          pass

Actual Domains:

  • 2D CSG
  • 3D CSG
  • Vector Graphics
  • Symbolic Regression
  • Flashfill
  • Theory Learning
  • Tangrams
  • Body Modeling

Actual Solvers:

  • Random
  • Enumeration
  • DeepCoder
  • Genetic Programming w/ Speciation
  • Genetic Programming w/o Speciation
  • EC
  • Learn To Search
Clone this wiki locally