From 16560ce5d6409e0f0326a0c6046960253e444ba4 Mon Sep 17 00:00:00 2001 From: Son Ho Date: Wed, 26 Oct 2022 19:42:30 +0200 Subject: Update the code documentation to fix links and syntax issues --- src/Expressions.ml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/Expressions.ml') diff --git a/src/Expressions.ml b/src/Expressions.ml index bf06dd1e..e2eaf1e7 100644 --- a/src/Expressions.ml +++ b/src/Expressions.ml @@ -82,21 +82,21 @@ type operand = Note that ADTs are desaggregated at some point in MIR. For instance, if we have in Rust: - ``` - let ls = Cons(hd, tl); - ``` + {[ + let ls = Cons(hd, tl); + ]} In MIR we have (yes, the discriminant update happens *at the end* for some reason): - ``` - (ls as Cons).0 = move hd; - (ls as Cons).1 = move tl; - discriminant(ls) = 0; // assuming `Cons` is the variant of index 0 - ``` + {[ + (ls as Cons).0 = move hd; + (ls as Cons).1 = move tl; + discriminant(ls) = 0; // assuming [Cons] is the variant of index 0 + ]} Note that in our semantics, we handle both cases (in case of desaggregated - initialization, `ls` is initialized to `⊥`, then this `⊥` is expanded to - `Cons (⊥, ⊥)` upon the first assignment, at which point we can initialize + initialization, [ls] is initialized to [⊥], then this [⊥] is expanded to + [Cons (⊥, ⊥)] upon the first assignment, at which point we can initialize the field 0, etc.). *) type aggregate_kind = -- cgit v1.2.3