-
Notifications
You must be signed in to change notification settings - Fork 6
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.
-
DSLs: {Class1, ..., ClassN}
- A DSL consists of a set of classes:
Where
DSL = {Add, Substract, Transpose, ...}
Add
,Subtract
, andTranspose
are all defined Python classes as described below.
- A DSL consists of a set of classes:
-
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
- A class within a DSL will consist of a signature (its name), a function, and a token that is able to be parsed:
-
Execute: Prog -> Spec
-
Execute(Prog, Spec)
will take both aProgram
and aSpec
and execute aSolver
to solve theDomain
-
-
Context: Spec* -> Ctx
- A
Context
takes aSpec*
and outputs aCtx
- A
-
Loss: Spec -> Prog -> Real Number
-
Loss
takes aSpec
andProgram
and outputs a real number detailing how close the currentProgram
andSpec
are to theSpec*
-
-
Solver: DSL -> Spec -> Loss -> Timeout -> [(progN, lossN, timeN)]
- A solver will take a
DSL
,Spec
,Loss
, and aTimeout
and output a list of size N of triples ofPrograms
,Losses
, andTimes
-
Timeout
is the maximum amount of time the solver has to solve theSpec
-
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
- A solver will take a
- 2D CSG
- 3D CSG
- Vector Graphics
- Symbolic Regression
- Flashfill
- Theory Learning
- Tangrams
- Body Modeling
- Random
- Enumeration
- DeepCoder
- Genetic Programming w/ Speciation
- Genetic Programming w/o Speciation
- EC
- Learn To Search