|
From: <chr...@us...> - 2012-02-24 12:50:32
|
Revision: 3568
http://dlvhex.svn.sourceforge.net/dlvhex/?rev=3568&view=rev
Author: chrisr86
Date: 2012-02-24 12:50:25 +0000 (Fri, 24 Feb 2012)
Log Message:
-----------
update benchmark script
Modified Paths:
--------------
dlvhex-dlplugin/branches/release2x/include/HexDLRewriter.h
dlvhex-dlplugin/branches/release2x/include/RacerInterface.h
dlvhex-dlplugin/branches/release2x/src/HexDLConverter.cpp
dlvhex-dlplugin/branches/release2x/src/RacerInterface.cpp
Modified: dlvhex-dlplugin/branches/release2x/include/HexDLRewriter.h
===================================================================
--- dlvhex-dlplugin/branches/release2x/include/HexDLRewriter.h 2012-02-24 12:49:47 UTC (rev 3567)
+++ dlvhex-dlplugin/branches/release2x/include/HexDLRewriter.h 2012-02-24 12:50:25 UTC (rev 3568)
@@ -77,10 +77,10 @@
return this->naf;
}
- virtual ID
+ virtual ComfortLiteral*
getLiteral() const
{
- return ID_FAIL;
+ return 0;
}
};
typedef boost::shared_ptr<HexDLRewriterBase> HexDLRewriterBasePtr;
@@ -102,10 +102,10 @@
void
getCQ(const std::string& query, const ComfortTuple& output, ComfortInterpretation& cq) const;
- virtual const Tuple&
+ virtual const ComfortTuple&
getInputTuple() const;
- virtual inline Tuple
+ virtual inline ComfortTuple
getOutputTuple() const
{
//return extAtom->getArguments();
@@ -113,7 +113,7 @@
public:
explicit
- ExtAtomRewriter(const ComfortAtom& ea);
+ ExtAtomRewriter(const boost::shared_ptr<dlvhex::ExternalAtom> ea);
virtual
~ExtAtomRewriter();
@@ -122,7 +122,7 @@
std::auto_ptr<ExtAtomRewriter>
push(const std::auto_ptr<ExtAtomRewriter>& b) const;
- virtual ID
+ virtual ComfortLiteral*
getLiteral() const;
};
@@ -214,22 +214,22 @@
DLAtomRewriter(const Ontology::shared_pointer& onto,
DLAtomInput& dlinput,
const ComfortInterpretation& o,
- const std::vector<ID>* cq,
+ const ComfortInterpretation* cq,
const ComfortTuple* out);
/// ucq-atom ctor
DLAtomRewriter(const Ontology::shared_pointer& onto,
DLAtomInput& dlinput,
const ComfortInterpretation& o,
- const std::vector<std::vector<ID> >* ucq,
+ const std::vector<ComfortInterpretation>* ucq,
const ComfortTuple* out);
~DLAtomRewriter();
- virtual ID
+ virtual ComfortLiteral*
getLiteral() const;
- const Tuple&
+ const ComfortTuple&
getInputTuple() const;
std::string
Modified: dlvhex-dlplugin/branches/release2x/include/RacerInterface.h
===================================================================
--- dlvhex-dlplugin/branches/release2x/include/RacerInterface.h 2012-02-24 12:49:47 UTC (rev 3567)
+++ dlvhex-dlplugin/branches/release2x/include/RacerInterface.h 2012-02-24 12:50:25 UTC (rev 3568)
@@ -135,10 +135,8 @@
/**
* @return the DL converter.
*/
-/* @TODO
- virtual std::vector<PluginConverter*>
- createConverters();
-*/
+ virtual std::vector<PluginConverterPtr>
+ createConverters(ProgramCtx& ctx);
/**
* @return the DL optimizer.
Modified: dlvhex-dlplugin/branches/release2x/src/HexDLConverter.cpp
===================================================================
--- dlvhex-dlplugin/branches/release2x/src/HexDLConverter.cpp 2012-02-24 12:49:47 UTC (rev 3567)
+++ dlvhex-dlplugin/branches/release2x/src/HexDLConverter.cpp 2012-02-24 12:50:25 UTC (rev 3568)
@@ -235,9 +235,6 @@
ConverterState state;
};
-#if 0
-// @TODO
-
struct handle_dlatom
{
handle_dlatom(ConverterState& state): state(state) {}
@@ -246,10 +243,10 @@
// cq: Query = dlvhex::AtomSet
// ucq: Query = std::vector<dlvhex::AtomSet>
template<typename Context, typename Query>
- void operator()(boost::fusion::vector3<boost::optional<dlvhex::AtomSet>, Query, dlvhex::ComfortTuple> const& args,
+ void operator()(boost::fusion::vector3<boost::optional<dlvhex::ComfortInterpretation>, Query, dlvhex::ComfortTuple> const& args,
Context& ctx, qi::unused_type) const
{
- dlvhex::AtomSet ops;
+ dlvhex::ComfortInterpretation ops;
if( boost::none != fusion::at_c<0>(args) )
ops = fusion::at_c<0>(args).get();
@@ -258,7 +255,7 @@
state.ontology, state.dlinput,
ops, &fusion::at_c<1>(args), &fusion::at_c<2>(args)));
- dlvhex::ID lit = rewriter->getLiteral();
+ dlvhex::ComfortLiteral* lit = rewriter->getLiteral();
state.out << *lit;
delete lit;
}
@@ -266,6 +263,8 @@
ConverterState& state;
};
+#if 0
+// @TODO
struct handle_dlextatom
{
handle_dlextatom(ConverterState& state): state(state) {}
@@ -289,13 +288,14 @@
atom = oss.str();
}
- dlvhex::ExternalAtomPtr extAtom(
- new dlvhex::ExternalAtom(atom, outputs, inputs, 0));
+ boost::shared_ptr<dlvhex::ExternalAtom> extAtom(
+ new dlvhex::ExternalAtom(ID::MAINKIND_ATOM | ID::SUBKIND_ATOM_EXTERNAL));
+ extAtomatom, outputs, inputs, 0));
dlvhex::dl::HexDLRewriterBasePtr rewriter(
new dlvhex::dl::ExtAtomRewriter(extAtom));
- dlvhex::Literal* lit = rewriter->getLiteral();
+ dlvhex::ComfortLiteral* lit = rewriter->getLiteral();
state.out << *lit;
delete lit;
}
Modified: dlvhex-dlplugin/branches/release2x/src/RacerInterface.cpp
===================================================================
--- dlvhex-dlplugin/branches/release2x/src/RacerInterface.cpp 2012-02-24 12:49:47 UTC (rev 3567)
+++ dlvhex-dlplugin/branches/release2x/src/RacerInterface.cpp 2012-02-24 12:50:25 UTC (rev 3568)
@@ -35,6 +35,8 @@
#include "config.h"
#endif /* HAVE_CONFIG_H */
+#include "dlvhex2/ProgramCtx.h"
+
#include "RacerInterface.h"
#include "RacerExtAtom.h"
#include "Ontology.h"
@@ -66,8 +68,8 @@
stats(new CacheStats),
cache(new Cache(*stats)),
// @TODO
-// dlconverter(new HexDLConverter),
- dfconverter(new dlvhex::df::DFConverter),
+ dlconverter(0),
+ dfconverter(0),
dfoutputbuilder(new dlvhex::df::DFOutputBuilder),
// @TODO
// dloptimizer(new DLOptimizer),
@@ -123,8 +125,8 @@
delete kbManager;
// @TODO
// delete dloptimizer;
-// delete dlconverter;
- delete dfconverter;
+ if (dlconverter) delete dlconverter;
+ if (dfconverter) delete dfconverter;
delete dfoutputbuilder;
delete cache;
delete stats;
@@ -139,21 +141,25 @@
return &ri;
}
-/* // @TODO
-std::vector<PluginConverter*>
-RacerInterface::createConverters()
+ // @TODO
+//std::vector<PluginConverter*>
+//RacerInterface::createConverters()
+std::vector<PluginConverterPtr> RacerInterface::createConverters(ProgramCtx& ctx)
{
- std::vector<PluginConverter*> cvts;
+// dlconverter = new HexDLConverter(ctx.registry());
+// dfconverter = new dlvhex::df::DFConverter();
+ std::vector<PluginConverterPtr> cvts;
+
// always push the dfconverter since default rules
// and dl-/HEX-rules are now can live in the same input
- cvts.push_back(dfconverter);
- cvts.push_back(dlconverter);
+// cvts.push_back(PluginConverterPtr(dfconverter));
+// cvts.push_back(PluginConverterPtr(dlconverter));
return cvts;
}
-
+/*
PluginOptimizer*
RacerInterface::createOptimizer()
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|