Skip to content

Discrepancy in max/min function usage between Section 4.1.1 and Section 4.3 in Zimpl User's Guide #2

@GitHubonline1396529

Description

@GitHubonline1396529

Description

While working with ZIMPL, I encountered a potential discrepancy in the documentation regarding the usage of the max and min functions. Specifically, the usage demonstrated in Section 4.1.1 (Numeric expressions), Table 2 appears to differ from the syntax used in Section 4.3 (Parameters).

Steps to Reproduce

According to the usage of max in Section 4.1.1 (Numeric expressions), Table 2, it is suggested that we can use max(s in S) e(s) to compute the maximum value of the function e over a set S. To verify this, I tested the following example:

# test.zpl

set I := { 1..3 };

var x;
param num := max(i in I) i^2;

minimize f: x;
subto c: x == num;

When running this model in SCIP, I received the following error:

SCIP> read test.zpl
*** Error 800: File test.zpl Line 5 : syntax error

After modifying the param statement to the syntax shown in Section 4.3, the issue was resolved:

param num := max <i> in I : i^2;

Questions

Does this discrepancy indicate an error in my model when using the syntax demonstrated in Section 4.1.1? Should the syntax max(i in I) i^2 work in certain contexts but I am simply using it incorrectly, or is it only illustrative and not intended to be a valid ZIMPL statement?

Environment

  • SCIP version: 9.2.0
  • ZIMPL version: 3.6.2
  • Operating System: Windows 10 22H2

Thank you for your time and assistance! I look forward to hearing your insights.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions