Library Beroal.FunListArg

Functions with variable number of arguments

Require Import Coq.Lists.List.
Require Beroal.Stream.
Require Beroal.Init.


non-dependent type of a function with arbitrary number and types of arguments
Definition type (r : Type)
:= fix rec (args : list Type) : Type
:= match args with
        | nilr
        | arg :: argssargrec argss
        end.

either:
  • add ignored last argument;
  • generalized axiom K of combinatory logic;
  • weakening in sequent calculus.

Definition weak (a b : Type) (xs : list Type)
        : (type a xs) → (type (ba) xs).

either:
  • add a copy of the last argument as the first argument;
  • generalized axiom S of combinatory logic;
  • contraction in sequent calculus.

Definition contraction (a b : Type) (xs : list Type)
        : (btype (ba) xs) → (type (ba) xs).

move the last argument to the begining
Definition rotate (a b : Type) (xs : list Type)
        : Init.iff_Type (type (ab) xs) (atype b xs).

pointwise operation
Definition pw a0 a1 b n (op : type b (Stream.replicate n a0))
         : type (a1b) (Stream.replicate n (a1a0)).