This repository was archived by the owner on Nov 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In the new implementation, ctx.Unify(ctx, arc, AllArcs) had to go. The issue is that the desired evaluation state was not passed down and AllArcs was used unconditionally. This means that for Evaluate it would evaluate too much, causing a cycle to be triggered. With the new incremental algorithm, this call to Unify was also redundant. In fact, not calling it results in more consistent error messages and a more consistent ordering of evaluation. It has therefore been removed. Fixes #622 This also improves various other evaluations. The changes in errormessages to structural.txtar are typciall for changes in order of evaluation are fine and in spec, as long as the same set of nodes are marked as an error (sub nodes of erroring nodes may be removed or added from the output). Change-Id: Icbd24891a48e421be900df40f622fd344a0bed4c Reviewed-on: https://cue-review.googlesource.com/c/cue/+/8211 Reviewed-by: Marcel van Lohuizen <[email protected]> Reviewed-by: CUE cueckoo <[email protected]> Reviewed-by: Paul Jolly <[email protected]>
- Loading branch information
Showing
5 changed files
with
278 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,272 @@ | ||
-- in.cue -- | ||
t1: a: { | ||
a1: a0 + 2 | ||
b1: a1 - 2 | ||
a0: X | ||
X: b1 | ||
X: 5.0 | ||
} | ||
|
||
t1: b: { | ||
X: 5.0 | ||
a1: a0 + 2 | ||
b1: a1 - 2 | ||
a0: X | ||
X: b1 | ||
} | ||
|
||
t1: c: { | ||
a1: a0 + 2 | ||
b1: a1 - 2 | ||
X: 5.0 | ||
a0: X | ||
X: b1 | ||
} | ||
|
||
t1: c: { | ||
b1: a1 - 2 | ||
a1: a0 + 2 | ||
X: 5.0 | ||
a0: X | ||
X: b1 | ||
} | ||
|
||
t1: c: { | ||
b1: a1 - 2 | ||
X: 5.0 | ||
a1: a0 + 2 | ||
a0: X | ||
X: b1 | ||
} | ||
|
||
t1total: { | ||
for _, v in t1 { v } | ||
} | ||
|
||
// Issue #622 | ||
t2: a: { | ||
a0: X | ||
a1: a0 * 2 | ||
Y: a1 | ||
|
||
b0: Y | ||
b1: b0 / 2 | ||
X: b1 | ||
|
||
X: 5.0 | ||
} | ||
|
||
t2: b: { | ||
b0: Y | ||
b1: b0 / 2 | ||
X: b1 | ||
|
||
a0: X | ||
a1: a0 * 2 | ||
Y: a1 | ||
|
||
X: 5.0 | ||
} | ||
|
||
t2: c: { | ||
b0: Y | ||
b1: b0 / 2 | ||
X: b1 | ||
|
||
X: 5.0 | ||
|
||
a0: X | ||
a1: a0 * 2 | ||
Y: a1 | ||
} | ||
|
||
t2: d: { | ||
b0: Y | ||
b1: b0 / 2 | ||
X: b1 | ||
|
||
a0: X | ||
a1: a0 * 2 | ||
Y: a1 | ||
|
||
X: 5.0 | ||
} | ||
|
||
t2total: { | ||
for _, v in t2 { v } | ||
} | ||
|
||
-- out/eval -- | ||
(struct){ | ||
t1: (struct){ | ||
a: (struct){ | ||
a1: (float){ 7.0 } | ||
b1: (float){ 5.0 } | ||
a0: (float){ 5.0 } | ||
X: (float){ 5.0 } | ||
} | ||
b: (struct){ | ||
X: (float){ 5.0 } | ||
a1: (float){ 7.0 } | ||
b1: (float){ 5.0 } | ||
a0: (float){ 5.0 } | ||
} | ||
c: (struct){ | ||
a1: (float){ 7.0 } | ||
b1: (float){ 5.0 } | ||
X: (float){ 5.0 } | ||
a0: (float){ 5.0 } | ||
} | ||
} | ||
t1total: (struct){ | ||
a1: (float){ 7.0 } | ||
b1: (float){ 5.0 } | ||
a0: (float){ 5.0 } | ||
X: (float){ 5.0 } | ||
} | ||
t2: (struct){ | ||
a: (struct){ | ||
a0: (float){ 5.0 } | ||
a1: (float){ 10.0 } | ||
Y: (float){ 10.0 } | ||
b0: (float){ 10.0 } | ||
b1: (float){ 5.0 } | ||
X: (float){ 5.0 } | ||
} | ||
b: (struct){ | ||
b0: (float){ 10.0 } | ||
b1: (float){ 5.0 } | ||
X: (float){ 5.0 } | ||
a0: (float){ 5.0 } | ||
a1: (float){ 10.0 } | ||
Y: (float){ 10.0 } | ||
} | ||
c: (struct){ | ||
b0: (float){ 10.0 } | ||
b1: (float){ 5.0 } | ||
X: (float){ 5.0 } | ||
a0: (float){ 5.0 } | ||
a1: (float){ 10.0 } | ||
Y: (float){ 10.0 } | ||
} | ||
d: (struct){ | ||
b0: (float){ 10.0 } | ||
b1: (float){ 5.0 } | ||
X: (float){ 5.0 } | ||
a0: (float){ 5.0 } | ||
a1: (float){ 10.0 } | ||
Y: (float){ 10.0 } | ||
} | ||
} | ||
t2total: (struct){ | ||
a0: (float){ 5.0 } | ||
a1: (float){ 10.0 } | ||
Y: (float){ 10.0 } | ||
b0: (float){ 10.0 } | ||
b1: (float){ 5.0 } | ||
X: (float){ 5.0 } | ||
} | ||
} | ||
-- out/compile -- | ||
--- in.cue | ||
{ | ||
t1: { | ||
a: { | ||
a1: (〈0;a0〉 + 2) | ||
b1: (〈0;a1〉 - 2) | ||
a0: 〈0;X〉 | ||
X: 〈0;b1〉 | ||
X: 5.0 | ||
} | ||
} | ||
t1: { | ||
b: { | ||
X: 5.0 | ||
a1: (〈0;a0〉 + 2) | ||
b1: (〈0;a1〉 - 2) | ||
a0: 〈0;X〉 | ||
X: 〈0;b1〉 | ||
} | ||
} | ||
t1: { | ||
c: { | ||
a1: (〈0;a0〉 + 2) | ||
b1: (〈0;a1〉 - 2) | ||
X: 5.0 | ||
a0: 〈0;X〉 | ||
X: 〈0;b1〉 | ||
} | ||
} | ||
t1: { | ||
c: { | ||
b1: (〈0;a1〉 - 2) | ||
a1: (〈0;a0〉 + 2) | ||
X: 5.0 | ||
a0: 〈0;X〉 | ||
X: 〈0;b1〉 | ||
} | ||
} | ||
t1: { | ||
c: { | ||
b1: (〈0;a1〉 - 2) | ||
X: 5.0 | ||
a1: (〈0;a0〉 + 2) | ||
a0: 〈0;X〉 | ||
X: 〈0;b1〉 | ||
} | ||
} | ||
t1total: { | ||
for _, v in 〈1;t1〉 { | ||
〈1;v〉 | ||
} | ||
} | ||
t2: { | ||
a: { | ||
a0: 〈0;X〉 | ||
a1: (〈0;a0〉 * 2) | ||
Y: 〈0;a1〉 | ||
b0: 〈0;Y〉 | ||
b1: (〈0;b0〉 / 2) | ||
X: 〈0;b1〉 | ||
X: 5.0 | ||
} | ||
} | ||
t2: { | ||
b: { | ||
b0: 〈0;Y〉 | ||
b1: (〈0;b0〉 / 2) | ||
X: 〈0;b1〉 | ||
a0: 〈0;X〉 | ||
a1: (〈0;a0〉 * 2) | ||
Y: 〈0;a1〉 | ||
X: 5.0 | ||
} | ||
} | ||
t2: { | ||
c: { | ||
b0: 〈0;Y〉 | ||
b1: (〈0;b0〉 / 2) | ||
X: 〈0;b1〉 | ||
X: 5.0 | ||
a0: 〈0;X〉 | ||
a1: (〈0;a0〉 * 2) | ||
Y: 〈0;a1〉 | ||
} | ||
} | ||
t2: { | ||
d: { | ||
b0: 〈0;Y〉 | ||
b1: (〈0;b0〉 / 2) | ||
X: 〈0;b1〉 | ||
a0: 〈0;X〉 | ||
a1: (〈0;a0〉 * 2) | ||
Y: 〈0;a1〉 | ||
X: 5.0 | ||
} | ||
} | ||
t2total: { | ||
for _, v in 〈1;t2〉 { | ||
〈1;v〉 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters