xsb is too slow
Issue #388
resolved
On the attached file, using xsb to calculate definitions is slower than without xsb..
Comments (4)
-
reporter -
The slow is caused by conversion from ~? to !~
XSB will generate all combinations of 4 companies and check whether for all these instances it holds that they are not controlled by some company.
The transformed definition is the following:
:- set_prolog_flag(unknown, fail). :- table idpxsb4139_uncontrolled/1. idpxsb4139_uncontrolled(IDPXSBc) :- idpxsb4141_temp24(IDPXSBc), idpxsb6_Company(IDPXSBc). idpxsb4140_temp25(IDPXSBx, IDPXSBu, IDPXSBy, IDPXSBz) :- idpxsb6_Company(IDPXSBz), idpxsb6_Company(IDPXSBy), idpxsb6_Company(IDPXSBu), idpxsb6_Company(IDPXSBx). idpxsb4141_temp24(IDPXSBc) :- idpxsb6_Company(IDPXSBc), forall(idpxsb4140_temp25(IDPXSBx, IDPXSBu, IDPXSBy, IDPXSBz), (\+ idpxsb4138_controlledx95xby(IDPXSBc, IDPXSBx, IDPXSBy, IDPXSBz, IDPXSBu))).
-
- changed component to XSB
-
- changed status to resolved
Optimised handling of rules of the form (p(x) <- ~?y : q(x,y))
Pushing down negations will result in !y : ~q(x,y) as rule body. However, this is a less efficient form.
This change implements a check whether there is directly a negation after the forall and if so, presents a simpler Prolog rule (one without forall/2).
This fixes issue
#388→ <<cset b1ffd2267348>>
- Log in to comment
Note: the definition here is very "inefficient" (because of the negation), but still, xsb should not be slower than ground&solve i guess ...