HN2new | past | comments | ask | show | jobs | submitlogin

That's not AI/Logic programming though. Ideally I'd write a boolean formula and the system tries to make it true by adjusting the values it can adjust.

Say I want something like the light should be off it is dark and the window is open (bugs), but if the window is closed and it is dark, the light should be on.

    dark & window.open -> !light
    dark & !window.open -> light
Obviously, it can't close the window. But it can turn the light to make the formulas true.

If this were answer-set-based, the system could find multiple ways to make the formulas true (that's why I say goal-based) and act in a truly intelligent manner.

Edit: if it could close the window, it had a second way to make the formulas true. That would be nice as well, that the window closes when I turn on the light.

Edit 2: note that at daytime the formulas are always true, such that I can adjust the light and window as I like.

Edit 3: We could also rewrite this as

    dark -> (window.open != light)
And it is great that we could reason about our rules in that manner.


> And it is great that we could reason about our rules in that manner.

That's what I've been missing as well. Node-RED comes close, but is event based.

I've been thinking of implementing this kind of system. It has similar principles to functional languages or a reactive system like Mgmt[0]. But I foresee a few issues that would render potential simple formulae into complex ones. Things like keeping state on event based inputs (push-type wall switches), time based decisions and outputs that don't provide feedback on their current state.

If I ever find the time to get practical with the idea and work out these issues I might put it into a Show HN.

[0] https://github.com/purpleidea/mgmt


That's an interesting idea, and I agree it would make a great addition to HA. From an outside standpoint it doesn't even seem to be that hard to implement, all the pieces are already there, "just" needs some glue.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: