~ubuntu-branches/ubuntu/wily/agda/wily-proposed

« back to all changes in this revision

Viewing changes to test/fail/Issue292c.agda

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2014-08-05 06:38:12 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20140805063812-io8e77niomivhd49
Tags: 2.4.0.2-1
* [6e140ac] Imported Upstream version 2.4.0.2
* [2049fc8] Update Build-Depends to match control
* [93dc4d4] Install the new primitives
* [e48f40f] Fix typo dev→doc

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
module Issue292c where
2
 
 
3
 
data ⊥ : Set where
4
 
 
5
 
infix 3 ¬_
6
 
 
7
 
¬_ : Set → Set
8
 
¬ P = P → ⊥
9
 
 
10
 
infix 4 _≅_
11
 
 
12
 
data _≅_ {A : Set} (x : A) : ∀ {B : Set} → B → Set where
13
 
  refl : x ≅ x
14
 
 
15
 
record Σ (A : Set) (B : A → Set) : Set where
16
 
  constructor _,_
17
 
  field
18
 
    proj₁ : A
19
 
    proj₂ : B proj₁
20
 
 
21
 
open Σ public
22
 
 
23
 
data Bool : Set where true false : Bool
24
 
 
25
 
data Unit1 : Set where unit1 : Unit1
26
 
data Unit2 : Set where unit2 : Unit2
27
 
 
28
 
D : Bool -> Set
29
 
D true  = Unit1
30
 
D false = Unit2
31
 
 
32
 
P : Set -> Set
33
 
P S = Σ S (\s → s ≅ unit1)
34
 
 
35
 
pbool : P (D true)
36
 
pbool = unit1 , refl
37
 
 
38
 
¬pbool2 : ¬ P (D false)
39
 
¬pbool2 ( unit2 , () )
40
 
 
41
 
{- expected error
42
 
unit2 ≅ unit1 should be empty, but that's not obvious to me
43
 
when checking that the clause ¬pbool2 (unit2 , ()) has type
44
 
¬ P (D false)
45
 
-}