%------------------------------------------------------------------------------
% File : DAT464_1 : TPTP v10.0.0. Released v10.0.0.
% Domain : Data Structures
% Problem : Flattening a tree before appending equals accumulator flattening.
% Version : Especial.
% English :
% Refs : [HH+21] Hajdu et al. (2021), Inductive Benchmarks for Automate
% : [Raw26] Rawson (2026), Email to Geoff Sutcliffe
% Source : [Raw26]
% Names : tree-crafted_flatten0_flatten2-0.p [Raw26]
% Status : Theorem
% Rating : ? v10.0.0
% Syntax : Number of formulae : 19 ( 7 unt; 12 typ; 0 def)
% Number of atoms : 7 ( 7 equ)
% Maximal formula atoms : 1 ( 1 avg)
% Number of connectives : 0 ( 0 ~; 0 |; 0 &)
% ( 0 <=>; 0 =>; 0 <=; 0 <~>)
% Maximal formula depth : 5 ( 3 avg)
% Maximal term depth : 4 ( 2 avg)
% Number of types : 3 ( 3 usr; 0 ari; 3 dat; 0 cdt)
% Number of type conns : 11 ( 6 >; 5 *; 0 +; 0 <<)
% Number of predicates : 1 ( 0 usr; 0 prp; 2-2 aty)
% Number of functors : 9 ( 9 usr; 3 con; 0-3 aty)
% Number of variables : 14 ( 14 !; 0 ?; 14 :)
% SPC : TF0_THM_EQU_NAR_DAT
% Comments :
%------------------------------------------------------------------------------
tff(nat_type,type-datatype,
nat: $tType ).
tff(list_type,type-datatype,
list: $tType ).
tff(tree_type,type-datatype,
tree: $tType ).
tff(zero_type,type-datatype_constructor,
zero: nat ).
tff(s_type,type-datatype_constructor,
s: nat > nat ).
tff(nil_type,type-datatype_constructor,
nil: list ).
tff(cons_type,type-datatype_constructor,
cons: ( nat * list ) > list ).
tff(leaf_type,type-datatype_constructor,
leaf: tree ).
tff(node_type,type-datatype_constructor,
node: ( tree * nat * tree ) > tree ).
tff(app_type,type,
app: ( list * list ) > list ).
tff(1,axiom,
! [R: list] : ( app(nil,R) = R ) ).
tff(2,axiom,
! [A: nat,L: list,R: list] : ( app(cons(A,L),R) = cons(A,app(L,R)) ) ).
tff(flatten0_type,type,
flatten0: tree > list ).
tff(3,axiom,
flatten0(leaf) = nil ).
tff(4,axiom,
! [P: tree,X: nat,Q: tree] : ( flatten0(node(P,X,Q)) = app(flatten0(P),cons(X,flatten0(Q))) ) ).
tff(flatten2_type,type,
flatten2: ( tree * list ) > list ).
tff(5,axiom,
! [R: list] : ( flatten2(leaf,R) = R ) ).
tff(6,axiom,
! [P: tree,X: nat,Q: tree,R: list] : ( flatten2(node(P,X,Q),R) = flatten2(P,cons(X,flatten2(Q,R))) ) ).
tff(goal,conjecture,
! [T: tree,L: list] : ( app(flatten0(T),L) = flatten2(T,L) ) ).
%------------------------------------------------------------------------------