- 慰安婦制度は強制的なものだったか?
- 強制連行の事実があったか?
- 従軍慰安婦は何人いたのか?
- 内地人 / 朝鮮人の割合はどれほどだったか?
- 元「慰安婦」の証言は信用に足るものか?
- 女性は自由意志で応募したのか?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. transmission | |
2. smell | |
3. larva | |
4. epidemic | |
5. blood system | |
6. infection | |
7. drainage | |
8. mosquito | |
9. village | |
10. liver |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Eval (eval) | |
results = [eval "(\\x. x) (\\x. x)" == "(\\ 0)", | |
eval "(\\x. x x) (\\x. \\y. x)" == "(\\ (\\ (\\ 1)))", | |
eval "(\\p. p (\\t. \\f. t)) ((\\f. \\s. \\b. b f s) (\\x. x) (\\x. \\y. x))" == "(\\ 0)", | |
eval "(\\x. \\y. \\z. x z (y z)) (\\x. \\y. x) (\\x. \\y. x) (\\x. \\y. x)" == "(\\ (\\ 1))", | |
eval "(\\m. m (\\x. \\t. \\f. f) (\\t. \\f. t)) ((\\n. \\s. \\z. s (n s z)) (\\s. \\z. s z))" == "(\\ (\\ 0))"] | |
main = do | |
let xs = filter (not . snd) $ zip [0..] results :: [(Int, Bool)] | |
if null xs then putStrLn "OK" |
型なしラムダ計算の実装を第一回の宿題とします.
変数名付きのラムダ項が String で与えられるので, 評価した上で名無し項を String で返す eval 関数を実装してください.
具体的には次のような関数になります:
eval "(\\x. \\y. x) (\\x. x)" -- -> "(\\ (\\ 0))"
ひな形は Eval.hs です. Test.hs を実行することでテストできます.
成功した場合次のようになります:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE TemplateHaskell, DeriveFunctor, DeriveFoldable #-} | |
import Prelude hiding (foldr) | |
import Data.Foldable | |
import Data.Thorn | |
data Rose a = Leaf | Rose a (Forest a) | |
deriving (Functor, Show, Foldable) | |
data Forest a = Forest [Rose a] |
hoge
import Data.List
main = do
x <- getContents
print x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Eval (run) where | |
import Type | |
import Infer | |
import Control.Arrow | |
import Debug.Trace | |
ti a b = trace (a ++ show b) b | |
t' a b = trace (a ++ show b) |
NewerOlder