open import Mockingbird.Forest.Base using (Forest)

module Mockingbird.Forest.Birds {b } (forest : Forest {b} {}) where

open import Level using (_⊔_)
open import Data.Product using (_×_; ∃-syntax)
open import Relation.Unary using (Pred)
open import Relation.Binary using (Rel)

open Forest forest

-- TODO: consider using implicit arguments in the predicates, e.g.
--   IsMockingbird M = ∀ {x} → M ∙ x ≈ x ∙ x.

IsComposition : (A B C : Bird)  Set (b  )
IsComposition A B C =  x  C  x  A  (B  x)

-- A forest ‘has composition’ if for every two birds A and B there exists a bird
-- C = A ∘ B such that C is the composition of A and B.
record HasComposition : Set (b  ) where
  infixr 6 _∘_

  field
    _∘_ : (A B : Bird)  Bird
    isComposition :  A B  IsComposition A B (A  B)

open HasComposition  ...  public

IsMockingbird : Pred Bird (b  )
IsMockingbird M =  x  M  x  x  x

record HasMockingbird : Set (b  ) where
  field
    M : Bird
    isMockingbird : IsMockingbird M

open HasMockingbird  ...  public

infix 4 _IsFondOf_
_IsFondOf_ : Rel Bird 
A IsFondOf B = A  B  B

IsEgocentric : Pred Bird 
IsEgocentric A = A IsFondOf A

Agree : (A B x : Bird)  Set 
Agree A B x = A  x  B  x

IsAgreeable : Pred Bird (b  )
IsAgreeable A =  B  ∃[ x ] Agree A B x

Compatible : Rel Bird (b  )
Compatible A B = ∃[ x ] ∃[ y ] (A  x  y) × (B  y  x)

IsHappy : Pred Bird (b  )
IsHappy A = Compatible A A

IsNormal : Pred Bird (b  )
IsNormal A = ∃[ x ] A IsFondOf x

infix 4 _IsFixatedOn_
_IsFixatedOn_ : Rel Bird (b  )
A IsFixatedOn B =  x  A  x  B

IsHopelesslyEgocentric : Pred Bird (b  )
IsHopelesslyEgocentric A = A IsFixatedOn A

IsKestrel : Pred Bird (b  )
IsKestrel K =  x y  (K  x)  y  x
-- Alternative definition:
-- IsKestrel K = ∀ x → K ∙ x IsFixatedOn x

record HasKestrel : Set (b  ) where
  field
    K : Bird
    isKestrel : IsKestrel K

open HasKestrel  ...  public

IsIdentity : Pred Bird (b  )
IsIdentity I =  x  I  x  x

record HasIdentity : Set (b  ) where
  field
    I : Bird
    isIdentity : IsIdentity I

open HasIdentity  ...  public

IsLark : Pred Bird (b  )
IsLark L =  x y  (L  x)  y  x  (y  y)

record HasLark : Set (b  ) where
  field
    L : Bird
    isLark : IsLark L

IsSageBird : Pred Bird (b  )
IsSageBird Θ =  x  x IsFondOf (Θ  x)

open HasLark  ...  public

record HasSageBird : Set (b  ) where
  field
    Θ : Bird
    isSageBird : IsSageBird Θ

IsBluebird : Pred Bird (b  )
IsBluebird B =  x y z  B  x  y  z  x  (y  z)

open HasSageBird  ...  public

record HasBluebird : Set (b  ) where
  field
    B : Bird
    isBluebird : IsBluebird B

open HasBluebird  ...  public
 
IsDove : Pred Bird (b  )
IsDove D =  x y z w  D  x  y  z  w  x  y  (z  w)

record HasDove : Set (b  ) where
  field
    D : Bird
    isDove : IsDove D

open HasDove  ...  public

IsBlackbird : Pred Bird (b  )
IsBlackbird B₁ =  x y z w  B₁  x  y  z  w  x  (y  z  w)

record HasBlackbird : Set (b  ) where
  field
    B₁ : Bird
    isBlackbird : IsBlackbird B₁

open HasBlackbird  ...  public

IsEagle : Pred Bird (b  )
IsEagle E =  x y z w v  E  x  y  z  w  v  x  y  (z  w  v)

record HasEagle : Set (b  ) where
  field
    E : Bird
    isEagle : IsEagle E

open HasEagle  ...  public

IsBunting : Pred Bird (b  )
IsBunting B₂ =  x y z w v  B₂  x  y  z  w  v  x  (y  z  w  v)

record HasBunting : Set (b  ) where
  field
    B₂ : Bird
    isBunting : IsBunting B₂

open HasBunting  ...  public

IsDickcissel : Pred Bird (b  )
IsDickcissel D₁ =  x y z w v  D₁  x  y  z  w  v  x  y  z  (w  v)

record HasDickcissel : Set (b  ) where
  field
    D₁ : Bird
    isDickcissel : IsDickcissel D₁

open HasDickcissel  ...  public

IsBecard : Pred Bird (b  )
IsBecard B₃ =  x y z w  B₃  x  y  z  w  x  (y  (z  w))

record HasBecard : Set (b  ) where
  field
    B₃ : Bird
    isBecard : IsBecard B₃

open HasBecard  ...  public

IsDovekie : Pred Bird (b  )
IsDovekie D₂ =  x y z w v  D₂  x  y  z  w  v  x  (y  z)  (w  v)

record HasDovekie : Set (b  ) where
  field
    D₂ : Bird
    isDovekie : IsDovekie D₂

open HasDovekie  ...  public

IsBaldEagle : Pred Bird (b  )
IsBaldEagle Ê =  x y₁ y₂ y₃ z₁ z₂ z₃  Ê  x  y₁  y₂  y₃  z₁  z₂  z₃  x  (y₁  y₂  y₃)  (z₁  z₂  z₃)

record HasBaldEagle : Set (b  ) where
  field
    Ê : Bird
    isBaldEagle : IsBaldEagle Ê

open HasBaldEagle  ...  public

IsWarbler : Pred Bird (b  )
IsWarbler W =  x y  W  x  y  x  y  y

record HasWarbler : Set (b  ) where
  field
    W : Bird
    isWarbler : IsWarbler W

open HasWarbler  ...  public

IsCardinal : Pred Bird (b  )
IsCardinal C =  x y z  C  x  y  z  x  z  y

record HasCardinal : Set (b  ) where
  field
    C : Bird
    isCardinal : IsCardinal C

open HasCardinal  ...  public

IsThrush : Pred Bird (b  )
IsThrush T =  x y  T  x  y  y  x

record HasThrush : Set (b  ) where
  field
    T : Bird
    isThrush : IsThrush T

open HasThrush  ...  public

Commute : (x y : Bird)  Set 
Commute x y = x  y  y  x

IsRobin : Pred Bird (b  )
IsRobin R =  x y z  R  x  y  z  y  z  x

record HasRobin : Set (b  ) where
  field
    R : Bird
    isRobin : IsRobin R

open HasRobin  ...  public

IsFinch : Pred Bird (b  )
IsFinch F =  x y z  F  x  y  z  z  y  x

record HasFinch : Set (b  ) where
  field
    F : Bird
    isFinch : IsFinch F

open HasFinch  ...  public

IsVireo : Pred Bird (b  )
IsVireo V =  x y z  V  x  y  z  z  x  y

record HasVireo : Set (b  ) where
  field
    V : Bird
    isVireo : IsVireo V

open HasVireo  ...  public

IsCardinalOnceRemoved : Pred Bird (b  )
IsCardinalOnceRemoved C* =  x y z w  C*  x  y  z  w  x  y  w  z

record HasCardinalOnceRemoved : Set (b  ) where
  field
    C* : Bird
    isCardinalOnceRemoved : IsCardinalOnceRemoved C*

open HasCardinalOnceRemoved  ...  public

IsRobinOnceRemoved : Pred Bird (b  )
IsRobinOnceRemoved R* =  x y z w  R*  x  y  z  w  x  z  w  y

record HasRobinOnceRemoved : Set (b  ) where
  field
    R* : Bird
    isRobinOnceRemoved : IsRobinOnceRemoved R*

open HasRobinOnceRemoved  ...  public

IsFinchOnceRemoved : Pred Bird (b  )
IsFinchOnceRemoved F* =  x y z w  F*  x  y  z  w  x  w  z  y

record HasFinchOnceRemoved : Set (b  ) where
  field
    F* : Bird
    isFinchOnceRemoved : IsFinchOnceRemoved F*

open HasFinchOnceRemoved  ...  public

IsVireoOnceRemoved : Pred Bird (b  )
IsVireoOnceRemoved V* =  x y z w  V*  x  y  z  w  x  w  y  z

record HasVireoOnceRemoved : Set (b  ) where
  field
    V* : Bird
    isVireoOnceRemoved : IsVireoOnceRemoved V*

open HasVireoOnceRemoved  ...  public

IsCardinalTwiceRemoved : Pred Bird (b  )
IsCardinalTwiceRemoved C** =  x y z₁ z₂ z₃  C**  x  y  z₁  z₂  z₃  x  y  z₁  z₃  z₂

record HasCardinalTwiceRemoved : Set (b  ) where
  field
    C** : Bird
    isCardinalTwiceRemoved : IsCardinalTwiceRemoved C**

open HasCardinalTwiceRemoved  ...  public

IsRobinTwiceRemoved : Pred Bird (b  )
IsRobinTwiceRemoved R** =  x y z₁ z₂ z₃  R**  x  y  z₁  z₂  z₃  x  y  z₂  z₃  z₁

record HasRobinTwiceRemoved : Set (b  ) where
  field
    R** : Bird
    isRobinTwiceRemoved : IsRobinTwiceRemoved R**

open HasRobinTwiceRemoved  ...  public

IsFinchTwiceRemoved : Pred Bird (b  )
IsFinchTwiceRemoved F** =  x y z₁ z₂ z₃  F**  x  y  z₁  z₂  z₃  x  y  z₃  z₂  z₁

record HasFinchTwiceRemoved : Set (b  ) where
  field
    F** : Bird
    isFinchTwiceRemoved : IsFinchTwiceRemoved F**

open HasFinchTwiceRemoved  ...  public

IsVireoTwiceRemoved : Pred Bird (b  )
IsVireoTwiceRemoved V** =  x y z₁ z₂ z₃  V**  x  y  z₁  z₂  z₃  x  y  z₃  z₁  z₂

record HasVireoTwiceRemoved : Set (b  ) where
  field
    V** : Bird
    isVireoTwiceRemoved : IsVireoTwiceRemoved V**

open HasVireoTwiceRemoved  ...  public

IsQueerBird : Pred Bird (b  )
IsQueerBird Q =  x y z  Q  x  y  z  y  (x  z)

record HasQueerBird : Set (b  ) where
  field
    Q : Bird
    isQueerBird : IsQueerBird Q

open HasQueerBird  ...  public

IsQuixoticBird : Pred Bird (b  )
IsQuixoticBird Q₁ =  x y z  Q₁  x  y  z  x  (z  y)

record HasQuixoticBird : Set (b  ) where
  field
    Q₁ : Bird
    isQuixoticBird : IsQuixoticBird Q₁

open HasQuixoticBird  ...  public

IsQuizzicalBird : Pred Bird (b  )
IsQuizzicalBird Q₂ =  x y z  Q₂  x  y  z  y  (z  x)

record HasQuizzicalBird : Set (b  ) where
  field
    Q₂ : Bird
    isQuizzicalBird : IsQuizzicalBird Q₂

open HasQuizzicalBird  ...  public

IsQuirkyBird : Pred Bird (b  )
IsQuirkyBird Q₃ =  x y z  Q₃  x  y  z  z  (x  y)

record HasQuirkyBird : Set (b  ) where
  field
    Q₃ : Bird
    isQuirkyBird : IsQuirkyBird Q₃

open HasQuirkyBird  ...  public

IsQuackyBird : Pred Bird (b  )
IsQuackyBird Q₄ =  x y z  Q₄  x  y  z  z  (y  x)

record HasQuackyBird : Set (b  ) where
  field
    Q₄ : Bird
    isQuackyBird : IsQuackyBird Q₄

open HasQuackyBird  ...  public

IsGoldfinch : Pred Bird (b  )
IsGoldfinch G =  x y z w  G  x  y  z  w  x  w  (y  z)

record HasGoldfinch : Set (b  ) where
  field
    G : Bird
    isGoldfinch : IsGoldfinch G

open HasGoldfinch  ...  public

IsDoubleMockingbird : Pred Bird (b  )
IsDoubleMockingbird M₂ =  x y  M₂  x  y  x  y  (x  y)

record HasDoubleMockingbird : Set (b  ) where
  field
    M₂ : Bird
    isDoubleMockingbird : IsDoubleMockingbird M₂

open HasDoubleMockingbird  ...  public

IsConverseWarbler : Pred Bird (b  )
IsConverseWarbler W′ =  x y  W′  x  y  y  x  x

record HasConverseWarbler : Set (b  ) where
  field
    W′ : Bird
    isConverseWarbler : IsConverseWarbler W′

open HasConverseWarbler  ...  public

IsWarblerOnceRemoved : Pred Bird (b  )
IsWarblerOnceRemoved W* =  x y z  W*  x  y  z  x  y  z  z

record HasWarblerOnceRemoved : Set (b  ) where
  field
    W* : Bird
    isWarblerOnceRemoved : IsWarblerOnceRemoved W*

open HasWarblerOnceRemoved  ...  public

IsWarblerTwiceRemoved : Pred Bird (b  )
IsWarblerTwiceRemoved W** =  x y z w  W**  x  y  z  w  x  y  z  w  w

record HasWarblerTwiceRemoved : Set (b  ) where
  field
    W** : Bird
    isWarblerTwiceRemoved : IsWarblerTwiceRemoved W**

open HasWarblerTwiceRemoved  ...  public

IsHummingbird : Pred Bird (b  )
IsHummingbird H =  x y z  H  x  y  z  x  y  z  y

record HasHummingbird : Set (b  ) where
  field
    H : Bird
    isHummingbird : IsHummingbird H

open HasHummingbird  ...  public

IsStarling : Pred Bird (b  )
IsStarling S =  x y z  S  x  y  z  x  z  (y  z)

record HasStarling : Set (b  ) where
  field
    S : Bird
    isStarling : IsStarling S

open HasStarling  ...  public

IsPhoenix : Pred Bird (b  )
IsPhoenix Φ =  x y z w  Φ  x  y  z  w  x  (y  w)  (z  w)

record HasPhoenix : Set (b  ) where
  field
    Φ : Bird
    isPhoenix : IsPhoenix Φ

open HasPhoenix  ...  public

IsPsiBird : Pred Bird (b  )
IsPsiBird Ψ =  x y z w  Ψ  x  y  z  w  x  (y  z)  (y  w)

record HasPsiBird : Set (b  ) where
  field
    Ψ : Bird
    isPsiBird : IsPsiBird Ψ

open HasPsiBird  ...  public

IsTuringBird : Pred Bird (b  )
IsTuringBird U =  x y  U  x  y  y  (x  x  y)

record HasTuringBird : Set (b  ) where
  field
    U : Bird
    isTuringBird : IsTuringBird U

open HasTuringBird  ...  public

IsOwl : Pred Bird (b  )
IsOwl O =  x y  O  x  y  y  (x  y)

record HasOwl : Set (b  ) where
  field
    O : Bird
    isOwl : IsOwl O

open HasOwl  ...  public

IsChoosy : Pred Bird (b  )
IsChoosy A =  x  A IsFondOf x  IsSageBird x

IsJaybird : Pred Bird (b  )
IsJaybird J =  x y z w  J  x  y  z  w  x  y  (x  w  z)

record HasJaybird : Set (b  ) where
  field
    J : Bird
    isJaybird : IsJaybird J

open HasJaybird  ...  public