Skip to content

Commit

Permalink
Added type annotations for stop_callback
Browse files Browse the repository at this point in the history
This is a bit of progress on #50.
  • Loading branch information
Calvin-L committed Aug 2, 2018
1 parent 1615194 commit 4b9c753
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions cozy/synthesis/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from collections import OrderedDict
import itertools
from typing import Callable

from cozy.syntax import (
INT, BOOL, TMap,
Expand Down Expand Up @@ -206,7 +207,7 @@ def search_for_improvements(
context : Context,
examples : [{str:object}],
cost_model : CostModel,
stop_callback,
stop_callback : Callable[[], bool],
hints : [Exp],
ops : [Op],
blacklist : {(Exp, Context, Pool, Exp) : str}):
Expand Down Expand Up @@ -391,12 +392,12 @@ def never_stop():
def improve(
target : Exp,
context : Context,
assumptions : Exp = T,
stop_callback = never_stop,
hints : [Exp] = (),
examples : [{str:object}] = (),
cost_model : CostModel = None,
ops : [Op] = ()):
assumptions : Exp = T,
stop_callback : Callable[[], bool] = never_stop,
hints : [Exp] = (),
examples : [{str:object}] = (),
cost_model : CostModel = None,
ops : [Op] = ()):
"""Improve the target expression using enumerative synthesis.
This function is a generator that yields increasingly better and better
Expand Down

0 comments on commit 4b9c753

Please sign in to comment.