Move more code out of Sign and into Main
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
parent
040c13caba
commit
f0da9a9020
|
@ -306,34 +306,4 @@ module WithProg (prog : Program) where
|
||||||
|
|
||||||
|
|
||||||
-- Debugging code: print the resulting map.
|
-- Debugging code: print the resulting map.
|
||||||
open import Data.Fin using (suc; zero)
|
|
||||||
open import Data.Fin.Show using () renaming (show to showFin)
|
|
||||||
open import Data.Nat.Show using () renaming (show to showNat)
|
|
||||||
open import Data.String using (_++_)
|
|
||||||
open import Data.List using () renaming (length to lengthˡ)
|
|
||||||
|
|
||||||
output = show signs
|
output = show signs
|
||||||
|
|
||||||
|
|
||||||
-- Debugging code: construct and run a program.
|
|
||||||
open import Data.Vec using (Vec; _∷_; [])
|
|
||||||
open import IO
|
|
||||||
open import Level using (0ℓ)
|
|
||||||
|
|
||||||
testCode : Vec Stmt _
|
|
||||||
testCode =
|
|
||||||
("zero" ← (# 0)) ∷
|
|
||||||
("pos" ← ((` "zero") Expr.+ (# 1))) ∷
|
|
||||||
("neg" ← ((` "zero") Expr.- (# 1))) ∷
|
|
||||||
("unknown" ← ((` "pos") Expr.+ (` "neg"))) ∷
|
|
||||||
[]
|
|
||||||
|
|
||||||
testProgram : Program
|
|
||||||
testProgram = record
|
|
||||||
{ length = _
|
|
||||||
; stmts = testCode
|
|
||||||
}
|
|
||||||
|
|
||||||
open WithProg testProgram using (output)
|
|
||||||
|
|
||||||
main = run {0ℓ} (putStrLn output)
|
|
||||||
|
|
25
Main.agda
Normal file
25
Main.agda
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
module Main where
|
||||||
|
|
||||||
|
open import Language
|
||||||
|
open import Analysis.Sign
|
||||||
|
open import Data.Vec using (Vec; _∷_; [])
|
||||||
|
open import IO
|
||||||
|
open import Level using (0ℓ)
|
||||||
|
|
||||||
|
testCode : Vec Stmt _
|
||||||
|
testCode =
|
||||||
|
("zero" ← (# 0)) ∷
|
||||||
|
("pos" ← ((` "zero") Expr.+ (# 1))) ∷
|
||||||
|
("neg" ← ((` "zero") Expr.- (# 1))) ∷
|
||||||
|
("unknown" ← ((` "pos") Expr.+ (` "neg"))) ∷
|
||||||
|
[]
|
||||||
|
|
||||||
|
testProgram : Program
|
||||||
|
testProgram = record
|
||||||
|
{ length = _
|
||||||
|
; stmts = testCode
|
||||||
|
}
|
||||||
|
|
||||||
|
open WithProg testProgram using (output)
|
||||||
|
|
||||||
|
main = run {0ℓ} (putStrLn output)
|
Loading…
Reference in New Issue
Block a user