------------------------------------------------------------------------------
-- Examples of translation of logical schemata
------------------------------------------------------------------------------

{-# OPTIONS --exact-split              #-}
{-# OPTIONS --no-sized-types           #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K                #-}

module FOL.SchemataATP where

open import FOL.Base

------------------------------------------------------------------------------

postulate _≡_ : D  D  Set

module NonSchemas where

  postulate
    A B C    : Set
           : D  Set
         : D  D  Set
       : D  D  D  Set

  postulate id : A  A
  {-# ATP prove id #-}

  postulate id¹ :  {x}   x   x
  {-# ATP prove id¹ #-}

  postulate id² :  {x y}   x y   x y
  {-# ATP prove id² #-}

  postulate ∨-comm : A  B  B  A
  {-# ATP prove ∨-comm #-}

  postulate ∨-comm² :  {x y}   x y   x y   x y   x y
  {-# ATP prove ∨-comm² #-}

  postulate ∧∨-dist : A  (B  C)  A  B  A  C
  {-# ATP prove ∧∨-dist #-}

  postulate
    ∧∨-dist³ :  {x y z} 
               ( x y z  ( x y z   x y z)) 
               ( x y z   x y z   x y z   x y z)
  {-# ATP prove ∧∨-dist³ #-}

module Schemas where

  postulate id : {A : Set}  A  A
  {-# ATP prove id #-}

  postulate id¹ : { : D  Set}   {x}   x   x
  {-# ATP prove id¹ #-}

  postulate id² : { : D  D  Set}   {x y}   x y   x y
  {-# ATP prove id² #-}

  postulate ∨-comm : {A B : Set}  A  B  A  B
  {-# ATP prove ∨-comm #-}

  postulate ∨-comm² : {  : D  D  Set}   {x y} 
                       x y   x y   x y   x y
  {-# ATP prove ∨-comm² #-}

  postulate ∧∨-dist : {A B C : Set}  A  (B  C)  A  B  A  C
  {-# ATP prove ∧∨-dist #-}

  postulate ∧∨-dist³ : {   : D  D  D  Set}   {x y z} 
                       ( x y z  ( x y z   x y z)) 
                       ( x y z   x y z   x y z   x y z)
  {-# ATP prove ∧∨-dist³ #-}

module SchemaInstances where

  -- A schema
  -- Current translation: ∀ p q x. app(p,x) → app(q,x).
  postulate schema : (A B : D  Set)   {x}  A x  B x

  -- Using the current translation, the ATPs can prove an instance of
  -- the schema.
  postulate
    d         : D
    A B       : D  Set
    instanceC : A d  B d
  {-# ATP prove instanceC schema #-}