Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected Absent Literal - Works in 2.8.7 (Windows) -> Not on 2.9.0 #878

Open
lloy0076 opened this issue Feb 11, 2025 · 5 comments
Open

Comments

@lloy0076
Copy link

Flattening ...
	CompilePass: Flatten with 'C:\Program Files\MiniZinc\share\minizinc\cp-sat' library ...
MiniZinc has encountered an internal error. This is a bug.
Please file a bug report using the MiniZinc bug tracker.
The internal error message was: 
"unexpected absent literal"
Process finished with non-zero exit code 1.
Finished in 381msec.

I am literally doing precisely what it asks me to.

Given the completely unhelpful error I cannot tell what is wrong at all.

@lloy0076
Copy link
Author

typename E::Val eval_id(EnvI& env, Expression* e) {

This seems to be the only time the code complains about "unexpected absent literal".

@lloy0076
Copy link
Author

lloy0076 commented Feb 11, 2025

% var int: total_preference = sum(s in student_set where assignment[s] > 0 /\ assignment[s] != num_projects) (
   let {
     var int: p = assignment[s];
     var opt int: score = someStudents[s].prefs[p].2; % THIS LINE CAUSES THE ERROR
   } in
        weightedScores[s, p]
 );

This is a row from someStudents. The prefs would be the prefs. It was the above that is causing the error.

ignore the fact that score is not used, by the way; that is a bug that I've only just seen

(id: 257, name: "5_Ron 5_Russel", current: <>, prefs: [(42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (18, 1, 50, 259), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (24, 4, 68, 257), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (32, 2, 90, 260), (33, 3, 93, 258), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>), (42, 5, <>, <>)])

@lloy0076
Copy link
Author

Hmm.

var int: total_preference = sum(s in student_set where assignment[s] > 0 /\ assignment[s] != num_projects) (
  let {
    var int: p = assignment[s];
    PreferencesArray: a = someStudents[s].prefs;
    var opt int: score = someStudents[fix(s)].prefs[p].2
  } in
       weightedScores[s, p]
);

I think it's throwing the error because p is not fixed. If I do fix(p) I will get a "unexpected absent literal" error. This makes sense but I thought the newer compiler's picked up unfixed or broken arrays? Maybe they don't.

@Dekker1 Dekker1 transferred this issue from MiniZinc/MiniZincIDE Feb 12, 2025
@cyderize
Copy link
Member

Hi, thanks for the bug report.

If you can't attach you're whole model/data here publicly, could you send your model and a data file where this happens to jason [at] minizinc.dev?

We'll have a look in the future at making that internal error report a location when possible to make it easier to narrow down a minimal reproduction or workaround.

@lloy0076
Copy link
Author

I am working on making a reproduction; sorry for the delay.

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

No branches or pull requests

2 participants