potassco / clingo

🤔 A grounder and solver for logic programs.
https://potassco.org/clingo
MIT License
601 stars 79 forks source link

Question: Polarity Heuristic of clasp #397

Closed mahi045 closed 1 year ago

mahi045 commented 1 year ago

It is a question: As I checked the code, clasp maintains the following hierarchy to choose the polarity of a variable:

user > saved > preferred > current sign score of heuristic > default value

I am interested to know about the purposes of different types of values (e.g., user and preferred values). Thanks in advance.

rkaminsk commented 1 year ago

This question might be better asked at the clasp project (@BenKaufmann). I think (but don't know) the values are related to the different heuristics offered by clasp:

BenKaufmann commented 1 year ago

@rkaminsk @mahi045 As an addition: the "preferred" type is currently only used if option "--opt-heuristic" contains "sign". In that case, variables occurring in a minimize statement have their "preferred" polarity set to the value that minimizes their overall weight.

mahi045 commented 1 year ago

Thanks to @rkaminsk and @BenKaufmann. Please clarify the following points:

rkaminsk commented 1 year ago

I am not sure what you are trying to ask here. Do you know about he different command-line options we are referring to?

Thanks to @rkaminsk and @BenKaufmann. Please clarify the following points:

* user: makes sense only for domain heuristic

* preferred: makes sense only for optimization problems.

* current: makes sense if there is no saved value for a variable

* default: makes sense if I specify the polarity via the command line
mahi045 commented 1 year ago

Sorry for the confusion. I have checked the command-line options you mentioned earlier. I tried to say:

Does it look good now?

BenKaufmann commented 1 year ago

Some minor additions:

mahi045 commented 1 year ago

Thanks, @rkaminsk, and @BenKaufmann, for the detailed information.