kanren icon indicating copy to clipboard operation
kanren copied to clipboard

Make `applyo` use constraints

Open brandonwillard opened this issue 5 years ago • 3 comments

buildo (soon to be replaced by applyo) will actually apply a rator to its rands and unify the result with its third argument: i.e. buildo(add, (1, 1), q_lv) should unify q_lv with 3.

We need to use the new constraint system to make sure that, for example, add(1, 1) is computed and unified with q_lv once rator_lv and rands_lv are fully ground in a goal like buildo(rator_lv, rands_lv, q_lv).

brandonwillard avatar Jan 01 '20 01:01 brandonwillard

There are some ambiguities regarding when/how a term should be constructed by the aforementioned constraint, and that leads me to believe that an entirely different goal should be designated to this function, and that applyo should simply cons the operator + arguments (like it currently does on most occasions).

brandonwillard avatar Mar 12 '20 16:03 brandonwillard

is this still relevant since there is applyo?

majidaldo avatar Jan 24 '23 03:01 majidaldo

is this still relevant since there is applyo?

Yes, applyo still doesn't use constraints and—as a result—isn't correct/complete.

brandonwillard avatar Feb 01 '23 01:02 brandonwillard