Skip to content

Commit b7fe669

Browse files
committed
kmir/rt/data: refactor #projectedUpdate to not use #setLocalValue recursively
1 parent 77abeec commit b7fe669

File tree

1 file changed

+2
-7
lines changed
  • kmir/src/kmir/kdist/mir-semantics/rt

1 file changed

+2
-7
lines changed

kmir/src/kmir/kdist/mir-semantics/rt/data.md

+2-7
Original file line numberDiff line numberDiff line change
@@ -535,16 +535,11 @@ The solution is to use rewrite operations in a downward pass through the project
535535
rule #readProjection(DEST, TV:TypedValue, .ProjectionElems, CONTEXTS, _, _)
536536
=> ProjectedUpdate(DEST, TV, CONTEXTS)
537537
538-
rule <k> #projectedUpdate(ProjectedUpdate(toLocal(I), typedValue(_, _, mutabilityMut), CONTEXTS), NEW, false)
539-
=> #setLocalValue(place(local(I), .ProjectionElems), #buildUpdate(NEW, CONTEXTS))
540-
...
541-
</k>
542-
[preserves-definedness] // valid conmtext ensured upon context construction
543-
544-
rule <k> #projectedUpdate(ProjectedUpdate(toLocal(I), _, CONTEXTS), NEW, true)
538+
rule <k> #projectedUpdate(ProjectedUpdate(toLocal(I), typedValue(_, _, MUT), CONTEXTS), NEW, FORCE)
545539
=> #forceSetLocal(local(I), #buildUpdate(NEW, CONTEXTS))
546540
...
547541
</k>
542+
requires MUT ==K mutabilityMut orBool FORCE
548543
[preserves-definedness] // valid conmtext ensured upon context construction
549544
550545
syntax KItem ::= #forceSetLocal ( Local , TypedLocal )

0 commit comments

Comments
 (0)