Commit Graph

103 Commits

Author SHA1 Message Date
Sashko Stubailo
0ef65cc782 Clean up all dependencies 2015-07-30 17:25:38 -07:00
David Glasser
43b4b30205 Release PLUGINS-PREVIEW@1
This included removing some internal version constraints. It would be
nice if package A could say "use B@2.0.0" (when both have changed), but
when they're both in the release, we need to make a release that has a
B@2.0.0-rc in it, which doesn't match that constraint. Fortunately,
constraints aren't necessary within a release anyway.
2015-07-22 23:19:11 -07:00
David Greenspan
0bdf05ce95 Link to NPM from logic-solver README 2015-05-06 16:45:19 -07:00
David Greenspan
5a512ea990 Link to Sudoku demo from README 2015-04-21 11:28:17 -07:00
David Greenspan
4af94c39bd Wordsmithing and fixes 2015-04-20 14:43:34 -07:00
David Greenspan
c6661177f4 Finish TOC 2015-04-20 14:43:33 -07:00
David Greenspan
93e23b4809 Rest of Logic Solver API
Needs final TOC
2015-04-20 14:43:33 -07:00
David Greenspan
2fabf95c92 Rename Solver#minimize to minimizeWeightedSum
Same with maximize.  The old names were too generic for what the
method actually does.
2015-04-20 14:43:33 -07:00
David Greenspan
c65465e215 Fix broken markup 2015-04-20 14:43:33 -07:00
David Greenspan
c3d45ede00 Outline complete table of contents 2015-04-20 14:43:33 -07:00
David Greenspan
03f06295f2 solve and solveAssuming docs 2015-04-20 14:43:33 -07:00
David Greenspan
590446181a Fix stray quote 2015-04-20 14:43:32 -07:00
David Greenspan
c206117c1e Demote "MiniSat" section from beginning to end 2015-04-20 14:43:32 -07:00
David Greenspan
92358119d3 More TOC (and move below Introduction) 2015-04-20 14:43:32 -07:00
David Greenspan
90db08176b Write section on Solver 2015-04-20 14:43:32 -07:00
David Greenspan
b96cedc220 Make Solver#ignoreUnknownVariables a method
in preparation for documenting it
2015-04-20 14:43:32 -07:00
David Greenspan
189eed798a Formula TOC 2015-04-20 14:43:32 -07:00
David Greenspan
66bc7626f2 Document Formulas 2015-04-20 14:43:31 -07:00
David Greenspan
71de34bbf2 More TOC and wordsmithing (TLC) 2015-04-20 14:43:31 -07:00
David Greenspan
2f36eac93b More docs, start TOC 2015-04-20 14:43:31 -07:00
David Greenspan
13312a97b6 Write about Terms 2015-04-20 14:43:31 -07:00
David Greenspan
90982efcc6 De-italicize "variable name" 2015-04-20 14:43:31 -07:00
David Greenspan
b2a8c2f63d Wordsmithing 2015-04-20 14:43:31 -07:00
David Greenspan
698977abf5 Document Variables 2015-04-20 14:43:30 -07:00
David Greenspan
a161fe467d Make noCreate a public 2nd arg to getVarNum 2015-04-20 14:43:30 -07:00
David Greenspan
5f6b0a083a Wordsmithing 2015-04-20 14:43:30 -07:00
David Greenspan
0f749741f7 Minor improvements 2015-04-20 14:43:30 -07:00
David Greenspan
44064263c2 Write a bunch of README text for Logic Solver! 2015-04-20 14:43:30 -07:00
David Greenspan
f6f267d44d Improve Logic.variableBits
check that the second argument is present

generate better variable names.  the generated
names don't have to be magic -- we will probably
document what they are -- but they should be a
little better than just appending a number.
it's reasonable to give variables names like
"1,1", and appending a 0 to that would make
"1,10", which is weird.  "1,1$0" is better.
2015-04-20 14:43:30 -07:00
David Greenspan
a61deafba1 Update constraint-solver for logic-solver changes 2015-04-20 14:43:30 -07:00
David Greenspan
7855bb87c3 Don't depend on "check", and provide type testers
The dependency on "check" was a real buzz-kill, especially when we
think of this package as something someone might run outside Meteor:

* `check` is really slow (mainly due to using exceptions for control 
flow, I think), giving you a choice of *either* argument-checking or
good performance out of the box

* `check` pulls in the `ejson` and `base64` packages

Type testers are functions like `Logic.isTerm`, which are much more
useful to have as part of the public API than "matchers" like
`Logic.Term` in the old code.
2015-04-20 14:43:30 -07:00
David Greenspan
dea8d09b80 Define Logic.isNameTerm, etc. type checks
Starting to break dependency on "check"
2015-04-20 14:43:29 -07:00
Sashko Stubailo
75a00fc279 Un-prerelease version numbers 2015-03-31 12:03:53 -07:00
Sashko Stubailo
82948d5054 Bump package versions for hopefully final RC 2015-03-31 11:45:57 -07:00
David Greenspan
e9286de47d Revert part of 5810fd6 to fix perf regression
This brings the "rails, gitlabhq" benchmark test back to about 45
seconds on my machine, rather than over 10 minutes.
2015-03-30 13:01:03 -07:00
Sashko Stubailo
26c040179b Bump a bunch of versions to be the newest 2015-03-25 16:17:48 -07:00
David Greenspan
1b85b8205e Enable detailed profiling of the constraint solver
See the report using METEOR_PROFILE=1
2015-03-13 10:47:52 -07:00
David Greenspan
9f15f41482 Solve the "unknown var" problem more elegantly
The constraint-solver now uses the logic-solver in such a way that
accessing variables that weren't part of the problem statement will
never throw an error.  That way, we don't have to worry about
present and future cases where we don't generate any logical formulas
involving a package "foo" and then we say to minimize some weighted
sum over packages including "foo".
2015-03-13 06:37:06 -07:00
David Greenspan
78efe0b06b Don't run logic-solver tests on client
see comment
2015-03-10 12:31:49 -07:00
David Greenspan
dbfd1291c7 Code review changes
Validate package names in CS.Input.  Fix comments.  Remove dead code.
Use an equality requirement at the end of logic-solver's minMax.
2015-03-10 12:22:19 -07:00
David Greenspan
de5e67356a Some clean-up and allow minimization strategies 2015-03-09 23:15:25 -07:00
David Greenspan
5810fd6c81 Prevent stack overflow in logic-solver
Turn recursive addClauses->useFormulaTerm->addClauses into iterative.
Also do a couple tweaks that seem to improve performance.

The "stack overflow bug" case is now hovering around 10-20 seconds.
(It's a failure case, but it sure takes a while to fail.)
2015-03-09 22:20:34 -07:00
David Greenspan
eda46a2824 Get rid of the "zeroGoal" flag
From running benchmarks while changing the code:
* It doesn't seem to slow things down to *always* try to "hit 0"
  when minimizing
* It does seem to slow things down if the "<= 0" constraint is
  expressed using <= instead of "forbid the terms with non-zero
  weights"

This change also fixes a bug where we required terms with zero
weights to be 0.
2015-03-06 15:53:31 -08:00
David Greenspan
a78393b1e7 Implement "allAnswers" flag in constraint solver
I thought it would help me write a test for a bug that turned
up in code review, but it doesn't.  Still, I'm sure it will be
useful.

Also, Logic.Solution#getFormula is something I've been wanting
to write for a while.
2015-03-06 12:47:34 -08:00
David Greenspan
d34fc87d9b Recompile minisat 2015-03-05 17:55:42 -08:00
David Greenspan
9869245b8e Improve comments in optimize.js 2015-03-05 08:48:09 -08:00
David Greenspan
90c6b3e1bb No longer shift vars by 1 in MiniSat C wrapper
See 26e00d4d75
2015-03-05 08:23:24 -08:00
David Greenspan
023d471831 Code review changes to minisat_wrapper
All except fixing the 0-based/1-based thing
2015-03-04 17:46:14 -08:00
David Greenspan
8789a91d58 More code review changes (minisat_wrapper) 2015-03-04 16:45:42 -08:00
David Greenspan
b4da76a7e8 Improve comments 2015-03-04 14:22:45 -08:00