From c1581075d3dffa7e32f2927d8aad132f8089740c Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Wed, 8 May 2024 23:30:23 -0700 Subject: [PATCH] Add more test programs Signed-off-by: Danila Fedorin --- Main.agda | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Main.agda b/Main.agda index 09ad11d..b847237 100644 --- a/Main.agda +++ b/Main.agda @@ -13,6 +13,25 @@ testCode = ⟨ "neg" ← ((` "zero") Expr.- (# 1)) ⟩ then ⟨ "unknown" ← ((` "pos") Expr.+ (` "neg")) ⟩ +testCodeCond₁ : Stmt +testCodeCond₁ = + ⟨ "var" ← (# 1) ⟩ then + if (` "var") then ( + ⟨ "var" ← ((` "var") Expr.+ (# 1)) ⟩ + ) else ( + ⟨ "var" ← ((` "var") Expr.- (# 1)) ⟩ then + ⟨ "var" ← (# 1) ⟩ + ) + +testCodeCond₂ : Stmt +testCodeCond₂ = + ⟨ "var" ← (# 1) ⟩ then + if (` "var") then ( + ⟨ "x" ← (# 1) ⟩ + ) else ( + ⟨ noop ⟩ + ) + testProgram : Program testProgram = record { rootStmt = testCode