Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/Compare.cc
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ namespace cadabra {
//
// if(!i1.is_valid() && !i2.is_valid())
// return match_t::subtree_match;

DEBUGLN( std::cerr << tab() << "equal_subtree with use_props = " << use_props << std::endl; );
++offset;

Expand Down
17 changes: 8 additions & 9 deletions core/IndexClassifier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,7 @@ Ex IndexClassifier::get_dummy(const list_property *dums,
const index_map_t * four,
const index_map_t * five) const
{
std::pair<Properties::pattern_map_t::const_iterator, Properties::pattern_map_t::const_iterator>
pr=kernel.properties.pats.equal_range(dums);
std::pair<Properties::const_iterator, Properties::const_iterator> pr=kernel.properties.equal_range(dums);

// std::cerr << "finding index not in: " << std::endl;
// if(one)
Expand All @@ -512,9 +511,9 @@ Ex IndexClassifier::get_dummy(const list_property *dums,

while(pr.first!=pr.second) {
// std::cerr << "trying: " << std::endl;
// std::cerr << pr.first->second->obj << std::endl;
// std::cerr << pr.first->second->obj << std::endl;
if(pr.first->second->obj.begin()->is_autodeclare_wildcard()) {
// std::cerr << "is autodeclare wildcard" << std::endl;
// std::cerr << "is autodeclare wildcard" << std::endl;
std::string base=*pr.first->second->obj.begin()->name_only();
int used=max_numbered_name(base, one, two, three, four, five);
std::ostringstream str;
Expand All @@ -526,15 +525,15 @@ Ex IndexClassifier::get_dummy(const list_property *dums,
return ret;
}
else {
// std::cerr << "is NOT autodeclare" << std::endl;
// std::cerr << "is NOT autodeclare" << std::endl;
const Ex& inm=(*pr.first).second->obj;
// BUG: even if only _{a} is in the used map, we should not
// accept ^{a}. But since ...
if(index_in_set(inm, one)==false &&
index_in_set(inm, two)==false &&
index_in_set(inm, three)==false &&
index_in_set(inm, four)==false &&
index_in_set(inm, five)==false) {
index_in_set(inm, two)==false &&
index_in_set(inm, three)==false &&
index_in_set(inm, four)==false &&
index_in_set(inm, five)==false) {
// std::cerr << "ok to use " << inm << std::endl;
return inm;
}
Expand Down
4 changes: 2 additions & 2 deletions core/Kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Kernel::~Kernel()
// std::cerr << "~Kernel() " << this << std::endl;
}

void Kernel::inject_property(property *prop, std::shared_ptr<Ex> ex, std::shared_ptr<Ex> param)
const property* Kernel::inject_property(property *prop, std::shared_ptr<Ex> ex, std::shared_ptr<Ex> param)
{
Ex::iterator it=ex->begin();

Expand All @@ -124,7 +124,7 @@ void Kernel::inject_property(property *prop, std::shared_ptr<Ex> ex, std::shared
}
// Validate and insert a copy of the property.
prop->validate(*this, ex);
properties.master_insert(Ex(it), prop);
return properties.master_insert(Ex(it), prop);
}

std::shared_ptr<cadabra::Ex> Kernel::ex_from_string(const std::string& s)
Expand Down
2 changes: 1 addition & 1 deletion core/Kernel.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace cadabra {

/// Inject a property into the system and attach it to the given pattern.
/// Transfers property ownership to the kernel.
void inject_property(property *prop, std::shared_ptr<Ex> pattern, std::shared_ptr<Ex> property_arguments);
const property* inject_property(property *prop, std::shared_ptr<Ex> pattern, std::shared_ptr<Ex> property_arguments);

/// Create an Ex expression object from a string, which will be parsed.
std::shared_ptr<Ex> ex_from_string(const std::string&);
Expand Down
Loading