(tripleIndex, prefix)
| 393 | // to the prefix if either our args are fully resolved, but our returns aren't. |
| 394 | // If that's the case, then our proposal will be to fill in our returns. |
| 395 | propose(tripleIndex, prefix) { |
| 396 | // if either our inputs aren't resolved or our returns are all filled |
| 397 | // in, then we don't have anything to propose |
| 398 | if(!fullyResolved(this.args, prefix) |
| 399 | || fullyResolved(this.returns, prefix)) return; |
| 400 | |
| 401 | // find out which of our returns we could propose a value for |
| 402 | let proposed; |
| 403 | for(let ret of this.returns) { |
| 404 | if(toValue(ret, prefix) === undefined) { |
| 405 | proposed = ret; |
| 406 | break; |
| 407 | } |
| 408 | } |
| 409 | |
| 410 | // Each implementation of a constraint has to provide what its potential |
| 411 | // cardinality will be. Raw constraints like >, for example, will never |
| 412 | // make a proposal, while something like + might return cardinality 1, and |
| 413 | // split some approximation. |
| 414 | return this.getProposal(tripleIndex, proposed, prefix); |
| 415 | } |
| 416 | |
| 417 | // Constraints accept a prefix if either we're solving for something unrelated, |
| 418 | // if their args aren't fully resolved yet (we can't compute yet!) or if their |
nothing calls this directly
no test coverage detected