AI::Prolog Math

Ovid on 2005-02-23T06:37:41

I barely have 'net access at night. I've improved the situation slightly by switching to a different outlet, but I think the electricity in this building is just too noisy and between 6 and 7, when people get home and start turning on their TVs, my DSL goes out (and there are only four apartments here, so it's not like a huge building.)



So after going around, buying supplies and generally trying to get things to work, I finally gave in and was at least relieved by having *some* connectivity. After I got that done, I had a weird realization about AI::Prolog. The reason I haven't done math is because I want to build the operators into the parser. However, those operators are merely syntactic sugar for regular Prolog predicates. If I get the predicates to work, I have math and I don't have to do much to the parser, though I confess that I'd like to update the parser at a later date.



Once I realized that, I added the is(X,Y) predicate. It took a while to get it to work, but once it did, it made things clearer about how to proceed on the rest of the math. However, in porting this predicate from XProlog, I saw that the original version did not match expected Prolog behavior. In fact, it fails drastically in some cases. I'm going to have to be careful about not blindly porting lest I copy bugs I don't want to copy.



Oh, and I added listing and println(X), too.


Buy a good UPS

Limbic Region on 2005-02-23T13:49:58

It's worth it - trust me.

A good UPS will not only work like a surge supressor to handle spikes and give you enough power to shut down when the power goes out - it will also give you a steady consistant stream of power.

Relatively speaking - they are not that expensive.

clean power, is not

jmm on 2005-02-23T13:52:12

If your power is too noisy, you might look into using a UPS. That might filter out the noise.

Be careful about extending that is operator - a recent slashdot item noted that Microsoft got a patent for is-not. :-)