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

No error when multiplying inequality constraints #684

Closed
extemporalgenome opened this issue Jan 27, 2021 · 2 comments
Closed

No error when multiplying inequality constraints #684

extemporalgenome opened this issue Jan 27, 2021 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@extemporalgenome
Copy link
Contributor

extemporalgenome commented Jan 27, 2021

What version of CUE are you using (cue version)?

$ cue version
v0.3.0-alpha6

Does this issue reproduce with the latest release?

yes

What did you do?

I was exploring a more concise/expressive way of minimum and maximum list length:

x: (>0) * [y]
x: (<5) * [y]

y: -1
x: [1,2,3,4]

https://cuelang.org/play/?id=CXTDnET25_-#cue@export@cue

What did you expect to see?

If this were a feature/operation in cue, I would expect so see x fail to validate because it does not have between 1 and 5 elements, and because those elements aren't all the value -1.

If this is not a feature of cue (and it appears not to be), I would expect to see a language-level error indicating that inequality constraints are not compatible with the multiplication operator.

What did you see instead?

cue eval results in:

x: [1, 2, 3, 4]
y: -1

The first two lines appear not to contribute any constraint, though commenting out the last line of the input yields:

x: >0*[y] & <5*[y]
y: -1

(so cue is parsing, rather than discarding, these constraints).

Note that multiplying inequality constraints together (such as <5 * >10) is also accepted by cue, but appears to have no validation effect either.

@mpvl
Copy link
Contributor

mpvl commented Jan 27, 2021

Duplicate of #680, but leaving because of the more descriptive title.

cueckoo pushed a commit that referenced this issue Jan 27, 2021
…s unreported

This also requires simplification of BoundExpr to simulate
complete cycle handling.

Fixes #475
Fixes #680
Fixes #684

Change-Id: I906d8cc6e3689abb74c7c1ebc2ba96ecd98aaf4c
@mpvl mpvl added duplicate This issue or pull request already exists and removed NeedsInvestigation labels Jan 27, 2021
@mpvl mpvl added this to the v0.3.0-evaluator-rewrite milestone Jan 27, 2021
cueckoo pushed a commit that referenced this issue Jan 28, 2021
…s unreported

This also requires simplification of BoundExpr to simulate
complete cycle handling.

Fixes #475
Fixes #680
Fixes #684

Change-Id: I906d8cc6e3689abb74c7c1ebc2ba96ecd98aaf4c
cueckoo pushed a commit that referenced this issue Jan 28, 2021
…s unreported

This also requires simplification of BoundExpr to simulate
complete cycle handling.

Fixes #475
Fixes #680
Fixes #684

Change-Id: I906d8cc6e3689abb74c7c1ebc2ba96ecd98aaf4c
@mpvl mpvl closed this as completed in c091274 Jan 28, 2021
@cueckoo
Copy link

cueckoo commented Jul 3, 2021

This issue has been migrated to cue-lang/cue#684.

For more details about CUE's migration to a new home, please see cue-lang/cue#1078.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants