Skip to content

Commit ec3e8cd

Browse files
Merge pull request #500 from formal-land/gy@ExprToCoq
`expression::Expr::to_coq`
2 parents 7822d71 + 2d8c898 commit ec3e8cd

File tree

4 files changed

+167
-278
lines changed

4 files changed

+167
-278
lines changed

CoqOfRust/examples/default/examples/rust_book/custom_types/structures.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M :=
216216
let* bottom_right :=
217217
let* α0 := M.read UnsupportedLiteral in
218218
let* α1 := M.read point in
219-
M.alloc (M.struct_record_update (α1) [ ("x", α0) ]) in
219+
M.alloc (M.struct_record_update α1 [ ("x", α0) ]) in
220220
let* _ :=
221221
let* _ :=
222222
let* α0 := M.get_function "std::io::stdio::_print" [] in

lib/src/coq.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pub(crate) enum Expression<'a> {
8989
name: Option<String>,
9090
is_monadic: bool,
9191
ty: Option<Rc<Expression<'a>>>,
92-
value: Rc<Expression<'a>>,
92+
init: Rc<Expression<'a>>,
9393
body: Rc<Expression<'a>>,
9494
},
9595
Match {
@@ -433,7 +433,7 @@ impl<'a> Expression<'a> {
433433
name,
434434
is_monadic,
435435
ty,
436-
value,
436+
init,
437437
body,
438438
} => {
439439
// NOTE: The following variable is intended to bypass self-referencing issue for borrow checkers.
@@ -461,10 +461,10 @@ impl<'a> Expression<'a> {
461461
text(" :="),
462462
]),
463463
line(),
464-
value.to_doc(false), // init
464+
init.to_doc(false),
465465
text(" in"),
466466
]),
467-
line(),
467+
hardline(),
468468
body.to_doc(false),
469469
]),
470470
)

0 commit comments

Comments
 (0)