AddPath "$COQTH/ARITH".
AddPath "$COQTH/BOOL".
AddPath "$COQTH/RELATIONS".
AddPath "$COQTH/SETS".
AddPath "$COQTH/LISTS".
AddPath "$COQTH/PROGRAMS".
AddPath "$COQTH/SYSTEM".
AddPath "$COQTH/CONTRIB".

Cd "$EXTBENCH".

Require Div.
Fml. Reset All. Extract All.
Write CAML File "Div". Drop.

Reset Initial.
Require Peano_dec.
Require TheoryList.
Fml. Reset All. Extract All.
Instantiate A Int.
Reset All. Extract All.
Write CAML File "TheoryList". Drop.

Reset Initial.
Require Ack "$COQTH/CONTRIB/Rocq/DEMOS/Ack".
Fml. Reset All. Extract All.
Write CAML File "Ack". Drop.

Reset Initial.
Require Ack_prog.
Fml. Reset All. Extract All.
Write CAML File "Ack_prog". Drop.

Reset Initial.
Require Compare_dec.
Fml. Reset All. Extract All.
Write CAML File "Compare_dec". Drop.

Reset Initial.
Require Compare_prog.
Fml. Reset All. Extract All.
Write CAML File "Compare_prog". Drop.

Reset Initial.
Require Dijkstra_proof.
Fml. Reset All. Extract All.
Attach V Int.
Realize eqV [n][m]if n = m then left else right.
Realize dec_E [n,m](if n < m then (Poids n m (S O)) else (Infini n m)).
Realize Ext [x]x.
Realize finit_V (enu_add 5 (enu_add 4  
                           (enu_add 3 (enu_add 2 (enu_add 1 
                                          (enu_add 0 enu_empty)))))).
Realize source 0.
Reset All. Extract All.
Write CAML File "Dijkstra_proof". Drop.

Reset Initial.
Require Dijkstra_prog.
Fml. Reset All. Extract All.
Attach V Int.
Realize eqV [n][m]if n = m then left else right.
Realize dec_E [n,m](if n < m then (Poids n m (S O)) else (Infini n m)).
Realize Ext [x]x.
Realize finit_V (enu_add 5 (enu_add 4  
                           (enu_add 3 (enu_add 2 (enu_add 1 
                                          (enu_add 0 enu_empty)))))).
Realize source 0.
Reset All. Extract All.
Write CAML File "Dijkstra_prog". Drop.

Reset Initial.
Require Euclid_proof.
Fml. Reset All. Extract All.
let rec to_int = [n]
 match n with
   O -> 0
| (S m) -> 1+(to_int m)
end match.
let rec to_nat = [N]
 (if N=0 then O else (S (to_nat (N-1)))).
let eucl_int = [N,M]
 (match (eucl_dev (to_nat N)(to_nat M)) with
   (pair q r) -> (pair (to_int q) (to_int r))
 end match).
Write CAML File "Euclid_proof". Drop.

Reset Initial.
Require Euclid_prog.
Fml. Reset All. Extract All.
let rec to_int = [n]
 match n with
   O -> 0
| (S m) -> 1+(to_int m)
end match.
let rec to_nat = [N]
 (if N=0 then O else (S (to_nat (N-1)))).
let eucl_int = [N,M]
 (match (eucl_dev (to_nat N)(to_nat M)) with
   (pair q r) -> (pair (to_int q) (to_int r))
 end match).
Write CAML File "Euclid_prog". Drop.

Reset Initial.
Require Floyd_proof.
Fml. Reset All. Extract All.
Attach V Int.
Realize eqV [n][m]if n = m then left else right.
Realize dec_E [n,m](if n < m then (Poids n m (S O)) else (Infini n m)).
Realize F_finit (enu_add 5 (enu_add 4  
                           (enu_add 3 (enu_add 2 (enu_add 1 
                                          (enu_add 0 enu_empty)))))).
Reset All. Extract All.
Write CAML File "Floyd_proof". Drop.

Reset Initial.
Require Floyd_prog.
Fml. Reset All. Extract All.
Attach V Int.
Realize eqV [n][m]if n = m then left else right.
Realize dec_E [n,m](if n < m then (Poids n m (S O)) else (Infini n m)).
Realize F_finit (enu_add 5 (enu_add 4  
                           (enu_add 3 (enu_add 2 (enu_add 1 
                                          (enu_add 0 enu_empty)))))).
Reset All. Extract All.
Write CAML File "Floyd_prog". Drop.

Reset Initial.
Require Heap_proof.
Fml. Reset All. Extract All.
Instantiate A Int.
Realize inf_total [x,y](if x<y then left else right).
Reset All. Extract All.
Write CAML File "Heap_proof". Drop.

Reset Initial.
Require Heap_prog.
Fml. Reset All. Extract All.
Instantiate A Int.
Realize inf_total [x,y](if x<y then left else right).
Reset All. Extract All.
Write CAML File "Heap_prog". Drop.

Reset Initial.
Require Mergesort_proof.
Fml. Reset All. Extract All.
Realize WF_rec [x,f](let rec F = [y](f y F) in (F x)).
Reset All. Extract All.
Write CAML File "Mergesort_proof". Drop.

Reset Initial.
Require Mergesort_prog.
Fml. Reset All. Extract All.
Realize WF_rec [x,f](let rec F = [y](f y F) in (F x)).
Reset All. Extract All.
Write CAML File "Mergesort_prog". Drop.

Reset Initial.
Require Peano_dec.
Fml. Reset All. Extract All.
Write CAML File "Peano_dec". Drop.

Reset Initial.
Require Peano_prog.
Fml. Reset All. Extract All.
Write CAML File "Peano_prog". Drop.

Reset Initial.
Require Quick_proof.
Fml. Reset All. Extract All.
Realize inf_sup [x,y](if x<y then left else right).
Instantiate A Int.
Reset All. Extract All.
Write CAML File "Quick_proof". Drop.

Reset Initial.
Require Quick_prog.
Fml. Reset All. Extract All.
Realize inf_sup [x,y](if x<y then left else right).
Instantiate A Int.
Reset All. Extract All.
Write CAML File "Quick_prog". Drop.

Reset Initial.
Require Quick2_proof.
Fml. Reset All. Extract All.
Realize inf_sup [x,y](if x<y then left else right).
Instantiate A Int.
Reset All. Extract All.
Write CAML File "Quick2_proof". Drop.

Reset Initial.
Require Quick2_prog.
Fml. Reset All. Extract All.
Realize inf_sup [x,y](if x<y then left else right).
Instantiate A Int.
Reset All. Extract All.
Write CAML File "Quick2_prog". Drop.

Reset Initial.
Require Tauto_proof.
Fml. Reset All. Extract All.
Instantiate A Int.
Reset All. Extract All.
Write CAML File "Tauto_proof". Drop.

Reset Initial.
Require Tauto_prog.
Fml. Reset All. Extract All.
Instantiate A Int.
Reset All. Extract All.
Write CAML File "Tauto_prog". Drop.

Reset Initial.
Require Warshall_proof.
Fml. Reset All. Extract All.
Attach V Int.
Realize eqV [n][m]if n = m then left else right.
Realize finit_V (enu_add 5 (enu_add 4  
                           (enu_add 3 (enu_add 2 (enu_add 1 
                                          (enu_add 0 enu_empty)))))).

Realize dec_E [n,m](if n < m then left else right).
Reset All. Extract All.
Write CAML File "Warshall_proof". Drop.

Reset Initial.
Require Warshall_prog.
Fml. Reset All. Extract All.
Attach V Int.
Realize eqV [n][m]if n = m then left else right.
Realize finit_V (enu_add 5 (enu_add 4  
                           (enu_add 3 (enu_add 2 (enu_add 1 
                                          (enu_add 0 enu_empty)))))).

Realize dec_E [n,m](if n < m then left else right).
Reset All. Extract All.
Write CAML File "Warshall_prog". Drop.
