Skip to content

Commit

Permalink
fixed possible bug in regex graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
ellisk42 committed Nov 29, 2019
1 parent 5f2ae02 commit 2249b3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def addStupidRegex(frontier, g):
stupidProgram = Program.parse("(lambda (r_kleene (lambda (r_dot $0)) $0))")
stupidRegex = stupidProgram.evaluate([])(pre.String(""))

if any( e.program == stupidProgram for e in frontier ): return frontier
if any( e.program == stupidProgram for e in frontier ): return frontier.normalize()
lp = g.logLikelihood(frontier.task.request, stupidProgram)
ll = sum(stupidRegex.match("".join(example)) for _,example in frontier.task.examples)
fe = FrontierEntry(logPrior=lp, logLikelihood=ll, program=stupidProgram)
Expand Down

0 comments on commit 2249b3f

Please sign in to comment.