Skip to content
This repository has been archived by the owner on Dec 22, 2021. It is now read-only.

"social networks" example doesn't work. #8

Open
ldltools opened this issue Aug 31, 2020 · 2 comments
Open

"social networks" example doesn't work. #8

ldltools opened this issue Aug 31, 2020 · 2 comments

Comments

@ldltools
Copy link

Hi, I've just started trying alchemy-2 with the soc-net example in the tutorial (http://alchemy.cs.washington.edu/mlns/tutorial/soc-net/smoking.mln),
but learnwts crashes after complaining "UNRECOVERABLE ERROR after parsing smoking.mln".
It looks like the idx > 0 part of src/logic/clause.h causes the problem.

  Predicate* getPredicate(const int& idx) const {
    if (idx > 0 && idx < getNumPredicates()){
      return (*predicates_)[idx];
    }   
    else return NULL;

Replacing the expression with idx >= 0 seems to fix the problem.
Is this a correct fix, or am I missing something?

@JoeDumoulin
Copy link
Contributor

I looked at this today and I think I got a little too eager about "fixing" null pointer references a while back. I will be testing this evening and then get back to you. I think your solution is close to the right one though.

@JoeDumoulin
Copy link
Contributor

I've created a pull request for your change. please give it a try and give us feedback.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants