Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F5332217
latereasoning.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Nov 21, 2:14 AM
Size
1 KB
Mime Type
text/x-c++
Expires
Mon, Nov 23, 2:14 AM (1 d, 16 h)
Engine
blob
Format
Raw Data
Handle
315826
Attached To
rXR Xreate
latereasoning.cpp
View Options
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Author: pgess <v.melnychenko@xreate.org>
* Created on June 7, 2018, 6:01 PM
*
* \file latereasoning.cpp
* \brief Late reasoninf support
*/
#include "aux/latereasoning.h"
#include "ast.h"
namespace xreate {namespace latereasoning {
boost::optional<Gringo::Symbol>
LateAnnotation::select(const std::list<Expression>& keys) const {
for(const auto& entry : guardedSymbols) {
const std::list<Expression>& keysExpected = entry.first;
auto keysIt = keys.begin();
bool result = true;
for(const Expression& keyExpected : keysExpected) {
if(!(keyExpected == *keysIt)) {
result = false;
break;
}
++keysIt;
}
if(!result) continue;
return entry.second;
}
return boost::none;
}
}}
Event Timeline
Log In to Comment