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 RankNTypes, ExistentialQuantification #-} | |
| -- forall X, N -> (X + 1 -> X) -> X | |
| -- N -> (forall X, (X + 1 -> X) -> X) | |
| -- => forall X, (X + 1 -> X) -> X | |
| -- | |
| -- forall X, (X -> X + 1) -> X -> N | |
| -- (exists X, (X -> X + 1) * X) -> N | |
| -- => exists X, (X -> X + 1) * 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
| main' に 初期状態を 与えればいい |
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
| # | |
| . ## | |
| .. ### | |
| ... ## # | |
| .... ##### | |
| ..... ## # | |
| ...... ### ## | |
| ....... ## # ### | |
| ........ |
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 Q41. | |
| Ltac split_all := try (split; split_all). | |
| Lemma bar : | |
| forall P Q R S : Prop, | |
| R -> Q -> P -> S -> (P /\ R) /\ (S /\ Q). | |
| Proof. | |
| intros P Q R S H0 H1 H2 H3. | |
| split_all. |
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 Q36. | |
| Require Import ZArith. | |
| Section Principal_Ideal. | |
| Variable a : Z. | |
| Definition pi : Set := { x : Z | ( a | x )%Z }. | |
| Program Definition plus(a b : pi) : pi := (a + b)%Z. | |
| Next Obligation. |
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
| #include <iostream> | |
| #include <stack> | |
| #include <utility> | |
| #include <exception> | |
| namespace Map { | |
| enum MapTag { Left, Right, Equal }; | |
| template <typename K, typename T> | |
| struct Map { |
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 DeriveFunctor #-} | |
| module Data.AVL | |
| ( AVL | |
| , size | |
| , toList | |
| , fromList | |
| , empty | |
| , singleton | |
| , findMin | |
| , findMax |
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 FlexibleContexts #-} | |
| import qualified Text.Parsec as P | |
| import Text.Parsec.String (Parser) | |
| import Data.List (intercalate) | |
| import Control.Applicative | |
| import Control.Monad | |
| import Control.Monad.Reader | |
| import Control.Monad.State | |
| import qualified Data.Map as M |
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 Q31. | |
| (* Section *) | |
| Section Poslist. | |
| (* A *) | |
| Variable A : Type. | |
| (* *) | |
| Inductive poslist : Type := | |
| pnil : A -> poslist |
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 Q26. | |
| Require Import NArith. | |
| Goal (221 * 293 * 389 * 397 + 17 = 14 * 119 * 127 * 151 * 313)%nat. | |
| Proof. | |
| apply Nat2N.inj. | |
| rewrite Nat2N.inj_add. | |
| rewrite Nat2N.inj_mul. rewrite Nat2N.inj_mul. rewrite Nat2N.inj_mul. | |
| rewrite Nat2N.inj_mul. rewrite Nat2N.inj_mul. | |
| rewrite Nat2N.inj_mul. rewrite Nat2N.inj_mul. | |
| simpl. reflexivity. |