From 082caae4981e793a8986b76d0ab31cdb3f8294a2 Mon Sep 17 00:00:00 2001 From: Aymeric Fromherz Date: Tue, 28 Mar 2023 12:48:44 +0900 Subject: [PATCH 1/7] Add support for let_in in Z3 backend --- compiler/verification/.z3backend.real.ml.swp | Bin 0 -> 53248 bytes compiler/verification/z3backend.real.ml | 9 +++++++++ 2 files changed, 9 insertions(+) create mode 100644 compiler/verification/.z3backend.real.ml.swp diff --git a/compiler/verification/.z3backend.real.ml.swp b/compiler/verification/.z3backend.real.ml.swp new file mode 100644 index 0000000000000000000000000000000000000000..b079121a62b355df7eed65f529a5845f7c19f5a9 GIT binary patch literal 53248 zcmeI53zVf-Rp)Pr3W7|001hk|PbxxgCEe98z}TH;sPrQ#=tt;RfTB{lb?d9Do4$|A zeROqoIv^l}0zPJAsueY*pqu$$jyjH)Z(>cF$y3w6#cIvfe`K_161b5xh>7L)!%~m_T zUG-YO)~xNScUr5BX4c(xfuxoiTy1pPyDsfpsMXJB?Zv5XR%=eRh7v3%zx`{Q0^1bW zhysKD($1S6U)i^J&u%?(-Nd!-o4)bvMo({F-=@Ge1-2=$O@VC+Y*S#H0^1bWroc7@ z{s~f`zxue!%c$3*Lfwvq@2iHs9~XY#9=?wc-T$ia`-S2AhllQ89ezJQe1CT6{#S?J zcZTohh62QLd`-As58n?A-G5BDepmRuDpV-G|8?Q|9pSq+bpNs8`b_x#g`xY84%fda zd_O8wD5n3l;reai`w2t$!{zO-Z3=8tV4DKl6xgP~HU+jRuuXw&3T#tgn*!Su*rvc& zgaWn2N<}v8as9*mf3*MKeoduP1AD-3@bQ09seC_pDYy@u1Si0w!Mh$`skFhj%Ip_*U>K zjQzKR1@JB4FEP%46xIHuE*H^Pemt9=#x^uPeRG-WJb$^{d>-~#)f|Hhhqu}R;S3sU2sc_x<6HV<~}R* zP(|`OK_thg%B%a`Q4&5(!c)p&URn4mk0(^3ZY+0VF-CAwksa;gf#dT;-Y)iAb?iL5)0(-UJt+jhiU({}P z&!Ay<1~gm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1nMzXDf--@^y+Ch(o$9)MncT7q1|;PI}J zNHOi+!TZt9H;0VH0-1OX;YQKo9O~etzaWDIx8+Rx?%=e9M!{zpoR!?QP^@Va)K{3o zDn28pTt}4b7!Dwd^EPP+VT?4!ON}WO$ldp1Ak%G zo2s2$lf0>jI24ehc7Sd;FIs>5^KJHUp3ksXRt3P3nhJK%ij{K1{)lrrp`*C)3Fj%< zSaAiXs%K?$tH!ta-ta)CN_;3k{_BzVQ`IXK9oib%bjEY3pXE<@hZ3|aoB;y2WAzHkTwB9YmvP4V|@z!Eo@c8LlwIf{u%zw zzkCj6*`q4S4+(PdN zgSY?ft4A*}Lyy{9mmM?Nic2sxOzLJ_EK2GPCR&SPB$Xl1k#_gWC)-IPvzFCGUM zo8a8WrwrqE)l6eB`0`j8Ua?pl3yrZyV)PEdTZ-LbqS>CVr2Y~5#zt{3`*F-OdA~q} zBw_lBSnD;=InEtQ>KfC^&01?=vDWirwV1JO^=tRj&SJhS76%}L1r^V~7f3L6j~7h_ zQ&xS{Yi{Yr)dpW-bUdc(9=FoAI++AiHUJb3PJgxu8z_HdGwol`9 zmC3j;$(~O|2dx$|S#ve|0|_^CJu6!Uf@5*vLGf0vgl3`ORr9Q0j^CVlij| zuDF&t^+LP?WjbUL?F failwith "[Z3 encoding] EArray unsupported" | ELit l -> ctx, translate_lit ctx l | EAbs _ -> failwith "[Z3 encoding] EAbs unsupported" + | EApp { f = head; args = [] } -> failwith "[Z3 encoding] let in" | EApp { f = head; args } -> ( match Marked.unmark head with | EOp { op; _ } -> translate_op ctx op args @@ -758,6 +759,14 @@ and translate_expr (ctx : context) (vc : typed expr) : context * Expr.expr = args (ctx, []) in ctx, Expr.mk_app ctx.ctx_z3 fd z3_args + | EAbs { binder; _ } -> + let vars, body = Bindlib.unmbind binder in + if Array.length vars != 1 || List.length args != 1 then + failwith "[Z3 encoding] EAbs not supported beyond let_in" + else + let arg = List.hd args in + let expr = Bindlib.msubst binder [| Marked.unmark arg |] in + translate_expr ctx expr | _ -> failwith "[Z3 encoding] EApp node: Catala function calls should only include \ From 71ebd3a2c7970a0da8cfc0218a67d4d4ac35e255 Mon Sep 17 00:00:00 2001 From: Aymeric Fromherz Date: Tue, 28 Mar 2023 12:49:14 +0900 Subject: [PATCH 2/7] Test for Z3 let_in --- tests/test_proof/good/let_in_condition.catala_en | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/test_proof/good/let_in_condition.catala_en diff --git a/tests/test_proof/good/let_in_condition.catala_en b/tests/test_proof/good/let_in_condition.catala_en new file mode 100644 index 000000000..a5b34deba --- /dev/null +++ b/tests/test_proof/good/let_in_condition.catala_en @@ -0,0 +1,12 @@ +## Test + +```catala +declaration scope A: + context x content boolean + +scope A: + definition x under condition + let y equals true in + y + consequence equals true +``` From c711b0b1d7495920bd22c0d30e09dee347acc1a7 Mon Sep 17 00:00:00 2001 From: Aymeric Fromherz Date: Tue, 28 Mar 2023 13:00:07 +0900 Subject: [PATCH 3/7] cleanup --- compiler/verification/.z3backend.real.ml.swp | Bin 53248 -> 0 bytes compiler/verification/z3backend.real.ml | 1 - 2 files changed, 1 deletion(-) delete mode 100644 compiler/verification/.z3backend.real.ml.swp diff --git a/compiler/verification/.z3backend.real.ml.swp b/compiler/verification/.z3backend.real.ml.swp deleted file mode 100644 index b079121a62b355df7eed65f529a5845f7c19f5a9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 53248 zcmeI53zVf-Rp)Pr3W7|001hk|PbxxgCEe98z}TH;sPrQ#=tt;RfTB{lb?d9Do4$|A zeROqoIv^l}0zPJAsueY*pqu$$jyjH)Z(>cF$y3w6#cIvfe`K_161b5xh>7L)!%~m_T zUG-YO)~xNScUr5BX4c(xfuxoiTy1pPyDsfpsMXJB?Zv5XR%=eRh7v3%zx`{Q0^1bW zhysKD($1S6U)i^J&u%?(-Nd!-o4)bvMo({F-=@Ge1-2=$O@VC+Y*S#H0^1bWroc7@ z{s~f`zxue!%c$3*Lfwvq@2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`ORr9Q0j^CVlij| zuDF&t^+LP?WjbUL?F failwith "[Z3 encoding] EArray unsupported" | ELit l -> ctx, translate_lit ctx l | EAbs _ -> failwith "[Z3 encoding] EAbs unsupported" - | EApp { f = head; args = [] } -> failwith "[Z3 encoding] let in" | EApp { f = head; args } -> ( match Marked.unmark head with | EOp { op; _ } -> translate_op ctx op args From 8fdd39d15a8d3bd6aab36392a0e18fa57797cb9c Mon Sep 17 00:00:00 2001 From: Aymeric Fromherz Date: Tue, 28 Mar 2023 13:01:41 +0900 Subject: [PATCH 4/7] Add negative test for let_in --- .../test_proof/bad/let_in_condition-empty.catala_en | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/test_proof/bad/let_in_condition-empty.catala_en diff --git a/tests/test_proof/bad/let_in_condition-empty.catala_en b/tests/test_proof/bad/let_in_condition-empty.catala_en new file mode 100644 index 000000000..484d00eae --- /dev/null +++ b/tests/test_proof/bad/let_in_condition-empty.catala_en @@ -0,0 +1,12 @@ +## Test + +```catala +declaration scope A: + context x content boolean + +scope A: + definition x under condition + let y equals false in + y + consequence equals true +``` From d0ef61219f3d98026e19b5a34acc334941dc1cd8 Mon Sep 17 00:00:00 2001 From: Aymeric Fromherz Date: Tue, 28 Mar 2023 13:03:44 +0900 Subject: [PATCH 5/7] Add expected outputs for tests --- .../test_proof/bad/let_in_condition-empty.catala_en | 12 ++++++++++++ tests/test_proof/good/let_in_condition.catala_en | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/tests/test_proof/bad/let_in_condition-empty.catala_en b/tests/test_proof/bad/let_in_condition-empty.catala_en index 484d00eae..b97255d15 100644 --- a/tests/test_proof/bad/let_in_condition-empty.catala_en +++ b/tests/test_proof/bad/let_in_condition-empty.catala_en @@ -10,3 +10,15 @@ scope A: y consequence equals true ``` + +```catala-test-inline +$ catala Interpret -s A +[ERROR] This variable evaluated to an empty term (no rule that defined it applied in this situation) + +┌─⯈ tests/test_proof/bad/let_in_condition-empty.catala_en:5.10-11: +└─┐ +5 │ context x content boolean + │ ‾ + └─ Test +#return code 255# +``` diff --git a/tests/test_proof/good/let_in_condition.catala_en b/tests/test_proof/good/let_in_condition.catala_en index a5b34deba..b6913081a 100644 --- a/tests/test_proof/good/let_in_condition.catala_en +++ b/tests/test_proof/good/let_in_condition.catala_en @@ -10,3 +10,8 @@ scope A: y consequence equals true ``` + +```catala-test-inline +$ catala Interpret -s A +[RESULT] Computation successful! +``` From 5f04e0efaf12e06a3256c8f88524d53d4a84d14c Mon Sep 17 00:00:00 2001 From: Aymeric Fromherz Date: Tue, 28 Mar 2023 13:08:24 +0900 Subject: [PATCH 6/7] cleanup --- compiler/verification/z3backend.real.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/verification/z3backend.real.ml b/compiler/verification/z3backend.real.ml index 6b414df07..1d8e57718 100644 --- a/compiler/verification/z3backend.real.ml +++ b/compiler/verification/z3backend.real.ml @@ -759,7 +759,7 @@ and translate_expr (ctx : context) (vc : typed expr) : context * Expr.expr = in ctx, Expr.mk_app ctx.ctx_z3 fd z3_args | EAbs { binder; _ } -> - let vars, body = Bindlib.unmbind binder in + let vars, _ = Bindlib.unmbind binder in if Array.length vars != 1 || List.length args != 1 then failwith "[Z3 encoding] EAbs not supported beyond let_in" else From 8780a483129e7c90017dee0ee67f6f784700e577 Mon Sep 17 00:00:00 2001 From: Aymeric Fromherz Date: Tue, 28 Mar 2023 22:51:03 +0900 Subject: [PATCH 7/7] Correct test invocations --- tests/test_proof/bad/let_in_condition-empty.catala_en | 7 +++---- tests/test_proof/good/let_in_condition.catala_en | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/test_proof/bad/let_in_condition-empty.catala_en b/tests/test_proof/bad/let_in_condition-empty.catala_en index b97255d15..bf2150665 100644 --- a/tests/test_proof/bad/let_in_condition-empty.catala_en +++ b/tests/test_proof/bad/let_in_condition-empty.catala_en @@ -12,13 +12,12 @@ scope A: ``` ```catala-test-inline -$ catala Interpret -s A -[ERROR] This variable evaluated to an empty term (no rule that defined it applied in this situation) - +$ catala Proof --disable_counterexamples +[ERROR] [A.x] This variable might return an empty error: ┌─⯈ tests/test_proof/bad/let_in_condition-empty.catala_en:5.10-11: └─┐ 5 │ context x content boolean │ ‾ └─ Test -#return code 255# +Counterexample generation is disabled so none was generated. ``` diff --git a/tests/test_proof/good/let_in_condition.catala_en b/tests/test_proof/good/let_in_condition.catala_en index b6913081a..c3a702ec2 100644 --- a/tests/test_proof/good/let_in_condition.catala_en +++ b/tests/test_proof/good/let_in_condition.catala_en @@ -12,6 +12,6 @@ scope A: ``` ```catala-test-inline -$ catala Interpret -s A -[RESULT] Computation successful! +$ catala Proof --disable_counterexamples +[RESULT] No errors found during the proof mode run. ```