TPTP Examples

This commit is contained in:
Brandon Rozek 2023-03-27 11:01:47 -04:00
commit 2b3a0ef47c
No known key found for this signature in database
GPG key ID: 26E457DA82C9F480
13 changed files with 289 additions and 0 deletions

58
Axioms/LIST-ROZEK.ax Normal file
View file

@ -0,0 +1,58 @@
%--------------------------------------------------------------------------
% File : NUM-ROZEK : TPTP v8.1.2.
% Domain : Data Structures
% Axioms : Lists - Head, Tail, and Length
%--------------------------------------------------------------------------
%-- List Basics
tff(list_t, type, list: $tType).
tff(list_nil, type, nil : list).
tff(list_cons, type,
cons: (
($int * list) > list
)
).
%-- Head
tff(head_t, type,
head: list > $int
).
tff(head_cons, axiom,
![H: $int, T: list]: (
head(cons(H, T)) = H
)
).
%-- Tail
tff(tail_t, type,
tail: list > list
).
tff(tail_cons, axiom,
![H: $int, T: list]: (
tail(cons(H, T)) = T
)
).
% Note: The existence of head and tail definition shows that
% cons is injective.
%-- Length
tff(length_t, type,
length: list > $int
).
tff(length_nil, axiom, length(nil) = 0).
tff(length_cons, axiom,
![H: $int, T: list]: (
length(cons(H, T)) = $sum(1, length(T))
)
).

42
Axioms/NUM-ROZEK.ax Normal file
View file

@ -0,0 +1,42 @@
%--------------------------------------------------------------------------
% File : NUM-ROZEK : TPTP v8.1.2.
% Domain : Number Theory
% Axioms : Number theory - Equality and Addition
%--------------------------------------------------------------------------
%-- Constants
fof(c1, axiom, "one" = successor("zero")).
fof(c1, axiom, "two" = successor("one")).
fof(c1, axiom, "three" = successor("two")).
fof(c1, axiom, "four" = successor("three")).
fof(c1, axiom, "five" = successor("four")).
%-- Equality with respect to natural numbers
fof(zero, axiom,
![X] : "zero" != successor(X)
).
fof(successor_equality, axiom,
![A, B]: (
(successor(A) = successor(B)) =>
(A = B)
)
).
% Note: Also shows that successor is an injective function
%-- Addition Axioms
fof(adding_zero, axiom,
![A]: add(A,"zero") = A
).
fof(addition, axiom,
![A, B]:
(add(A,successor(B)) =
successor(add(A,B)))
).
%--------------------------------------------------------------------------