Exemple #1
0
	//NOTE: modifies the theory and the structure. Clone before passing them!
	static AbstractGroundTheory* doGrounding(AbstractTheory* theory, Structure* structure, Vocabulary* outputvocabulary, Term* term,
			TraceMonitor* tracemonitor, bool nbModelsEquivalent, GroundingReceiver* solver) {
		if(useLazyGrounding()){
			throw notyetimplemented("Retrieving a ground theory when lazy grounding is enabled");
		}
		auto result = createGroundingAndExtender(theory, structure, outputvocabulary, term, tracemonitor, nbModelsEquivalent, solver);
		delete(result.second);
		return result.first;
	}
Exemple #2
0
	const Tuple2AtomMap& getIntroducedLiteralsFor(PFSymbol* symbol) const{
		if(not hasSymbol(symbol)){
			return emptymap;
		}
		auto offset = getSymbol(symbol);
		Assert(offset.offset!=-1);
		if(offset.functionlist){
			throw notyetimplemented("Lazy grounding with support for function symbols in the grounding");
		}else{
			return symbols[offset.offset]->tuple2atom;
		}
	}
Exemple #3
0
	static std::pair<AbstractGroundTheory*, StructureExtender*> createGroundingAndExtender(AbstractTheory* theory, Structure* structure,
			Vocabulary* outputvocabulary, Term* term, TraceMonitor* tracemonitor, bool nbModelsEquivalent, GroundingReceiver* solver) {
		if (theory == NULL || structure == NULL) {
			throw IdpException("Unexpected NULL-pointer.");
		}
		auto t = dynamic_cast<Theory*>(theory); // TODO handle other cases
		if (t == NULL) {
			throw notyetimplemented("Grounding of already ground theories");
		}
		if (t->vocabulary() != structure->vocabulary()) {
			throw IdpException("Grounding requires that the theory and structure range over the same vocabulary.");
		}
		auto m = new GroundingInference(t, structure, outputvocabulary, term, tracemonitor, nbModelsEquivalent, solver);
		auto grounding = m->ground();
		auto result = std::pair<AbstractGroundTheory*, StructureExtender*>{grounding, m->getManager()};
		delete(m);
		return result;
	}
Exemple #4
0
	std::ostream& put(std::ostream&) const{
		throw notyetimplemented("Printing of ground theories");
	}
Exemple #5
0
	std::vector<TheoryComponent*> getComponents() const {
		throw notyetimplemented("Cannot retrieve components to a ground theory");
	}
Exemple #6
0
	void add(TheoryComponent*) {
		throw notyetimplemented("Cannot add components to a ground theory");
	}