340 likes | 444 Views
University of Milan. Helsinki university of technology. An Efficient Implementation for Calculating Stable Models of Kernel Programs. Fabrizio Magni Relatore: Prof. Alessandro Provetti Corelatore: Prof. Ilka Niemela. Aims of this Thesis. Studying of kernel semantic,
E N D
University of Milan Helsinki university of technology An Efficient Implementation for Calculating Stable Models of Kernel Programs Fabrizio Magni Relatore: Prof. Alessandro Provetti Corelatore: Prof. Ilka Niemela
Aims of this Thesis • Studying of kernel semantic, • Studying of SMODELS and its algorithms; • Modifing SMODELS in order to handle kernel program efficiently.
Secondary Aims • Improving SMODELS under ussumption of input kernel programs • Testing with SAT problems and benchmarking; • Kernel program generator.
Logic Program a not b.b not c.c not a, not d.d b.e not b, a.
Kernel Program a not b.b not c.c not a.e not b.
Kernel of a logic Program Main characteristic: • It contains only the information useful for the computetion of the Stable Models. • It is well-founded; • It is totally negative; • It contains only negative loops and bridges. For further information look at the papers of Brignoli, Costantini, D’Antona and Provetti. Further Information:
How to Calculate a Kernel Program (Kernelization) • Well-founded semantic; • operator; • Iterating unfolding; • Iterating top; • Erasing the still positive rules (or partially positive). Read the paper: Costantini et al., 1999. Further Information:
Main Steps of the previos thesis: Kernelizer SMODELS Logic Program Parsed Kernel Stable Models
Improvment of a Kernel Program • Faster than a normal logic program (usually the program is shorter in lenght); • Semantically homogeneous.
Functions in SMODELS See the text slides
Works in progress • Improving of Smodels calculation time • Inserting the kernel semantic in smodels rules • benchmarking
Smodel –kernelized Test program kernel MakeWFF generator cnf2ksm Script CNF Smodels Lparse program Conjunctive normal form
MakeWff parameter: Makewff #length #variables #rules #rules / #variables = 1,5 ...... 10
Number of Stable Models: 2191578960 Duration: 513.322 Number of choice points: 2191579236 Number of wrong choices: 2191579236 Number of atoms: 101 Number of rules: 300 Number of picked atoms: 2455708082 Number of forced atoms: 393430 Number of truth assignments: 1078181615 Size of searchspace (removed): 100 (0) real 14:42:33.7 user 14:27:31.9 sys 1.0 NORMAL VERSION 4_50_200.res
Reading...done Number of Stable Models: 2191578960 Duration: 2048.026 Number of choice points: 2234501931 Number of wrong choices: 2234501931 Number of atoms: 101 Number of rules: 300 Number of picked atoms: 2234501931 Number of forced atoms: 0 Number of truth assignments: 2384993934 Size of searchspace (removed): 101 (0) real 7:47:24.3 user 7:43:37.5 sys 0.3 4_50_200.res KERNEL VERSION
Testing We tested smodels with about 200 kernelized program The results show that the effeciency is increased about 30..50%
University of Milan Helsinki university of technology Alan Franzi University of Milan (now accomodated at the Teknillinen korkeakoulu) BASp & Co. Question can be send: -> Email: afranzi@cs.hut.fi -> Voice: Sorry, only in italian version
BASp Benchmark for ASP THE benchmark suite to test ASP implementation software
BASp • 1. why ? • 2. architecture • 3. features • 4. future works • Smodels –kernelized performance • 1. our preliminar test • 2. results
Main idea: Computing with default logic [P. Cholewinski] TheoryBase The Stanford Graph Base Others
Why ? • a lot of programs that works width different, and sometimes incomparable, type of logic programs. We can not compare one to each other 2. random programs are not significative in the real application We can’t understand if one implementation is more efficient compared with others in the real application.
What we need • Easy to use !! • Easy to expand with new problems • Flexible • Ready for future ASP implementation
BASp architecture BASp Encoding module engine Problem module engine Block world generator Stanford graph base Smodels DeRes Dlv Future Ksmodels Smodels Queen graph Simplex graph
Module engine Encoding module engine Block world generator Stanford graph base generator • Convert specific output from each generator into generic format for the problem engine. • Trasform the input command line of BASp and pass at the generetor
Encoding module engine • Used as a graph generator • Common characteristic • Increasing size Block world generator Stanford graph base Queen graph Simplex graph Future work
Encoding module engine Fact: a ,b and c Block world generator Stanford graph base A Queen graph Simplex graph C B
Module engine test Problem module engine Smodels DeRes Dlv Future Takes in input the generic format and selected problem and then creates the program for the specific implementation Ksmodels Smodels Future work
Problem module engine Each solver module describe specific problems Smodels DeRes Dlv Coloring Hamilton Cover Vertx Future Ksmodels Smodels Coloring Hamilton Coloring
Features %1> BASp –syntax Smodels –p hamilton –g simplex –n 23 %1> BASp –syntax all –p all –g simplex –n 23 %1> BASp –syntax all –p all –g all –n 0 Random generation size All avaible problem
Future work • Implement DLV and DeRes module • Create block world engine and problem • Design a graphic interface • Extend problems set
Special thanks Ilkka Niemelä Alessandro Provetti Tommi Syrjänen Stefania Costantini James T. Kirk