First commits.

This commit is contained in:
Naveen Sundar Govindarajulu 2017-01-14 22:08:51 -05:00
parent ecd7c00454
commit 8c78a2f8e5
237 changed files with 36267 additions and 0 deletions

View file

@ -0,0 +1,47 @@
;--------------------------------------------------------------------------
; File : BOO002-1 : TPTP v2.2.0. Released v1.0.0.
; Domain : Boolean Algebra (Ternary)
; Problem : In B3 algebra, X * X^-1 * Y = Y
; Version : [OTTER] (equality) axioms : Reduced > Incomplete.
; English :
; Refs : [LO85] Lusk & Overbeek (1985), Reasoning about Equality
; : [Ove90] Overbeek (1990), ATP competition announced at CADE-10
; : [Ove93] Overbeek (1993), The CADE-11 Competitions: A Personal
; : [LM93] Lusk & McCune (1993), Uniform Strategies: The CADE-11
; : [Zha93] Zhang (1993), Automated Proofs of Equality Problems in
; Source : [Ove90]
; Names : Problem 5 [LO85]
; : CADE-11 Competition Eq-3 [Ove90]
; : THEOREM EQ-3 [LM93]
; : PROBLEM 3 [Zha93]
; Status : unsatisfiable
; Rating : 0.33 v2.2.0, 0.43 v2.1.0, 0.38 v2.0.0
; Syntax : Number of clauses : 5 ( 0 non-Horn; 5 unit; 1 RR)
; Number of literals : 5 ( 5 equality)
; Maximal clause size : 1 ( 1 average)
; Number of predicates : 1 ( 0 propositional; 2-2 arity)
; Number of functors : 4 ( 2 constant; 0-3 arity)
; Number of variables : 11 ( 2 singleton)
; Maximal term depth : 3 ( 2 average)
; Comments :
; : tptp2X -f kif -t rm_equality:rstfp BOO002-1.p
;--------------------------------------------------------------------------
; associativity, axiom.
(or (= (multiply (multiply ?A ?B ?C) ?D (multiply ?A ?B ?E)) (multiply ?A ?B (multiply ?C ?D ?E))))
; ternary_multiply_1, axiom.
(or (= (multiply ?A ?B ?B) ?B))
; ternary_multiply_2, axiom.
(or (= (multiply ?A ?A ?B) ?A))
; left_inverse, axiom.
(or (= (multiply (inverse ?A) ?A ?B) ?B))
; prove_equation, conjecture.
(or (/= (multiply a (inverse a) b) b))
;--------------------------------------------------------------------------

View file

@ -0,0 +1,53 @@
;--------------------------------------------------------------------------
; File : COL003-1 : TPTP v2.2.0. Released v1.0.0.
; Domain : Combinatory Logic
; Problem : Strong fixed point for B and W
; Version : [WM88] (equality) axioms.
; English : The strong fixed point property holds for the set
; P consisting of the combinators B and W alone, where ((Bx)y)z
; = x(yz) and (Wx)y = (xy)y.
; Refs : [Smu85] Smullyan (1978), To Mock a Mocking Bird and Other Logi
; : [MW87] McCune & Wos (1987), A Case Study in Automated Theorem
; : [WM88] Wos & McCune (1988), Challenge Problems Focusing on Eq
; : [Wos88] Wos (1988), Automated Reasoning - 33 Basic Research Pr
; : [Ove90] Overbeek (1990), ATP competition announced at CADE-10
; : [LW92] Lusk & Wos (1992), Benchmark Problems in Which Equalit
; : [Wos93] Wos (1993), The Kernel Strategy and Its Use for the St
; : [Ove93] Overbeek (1993), The CADE-11 Competitions: A Personal
; : [LM93] Lusk & McCune (1993), Uniform Strategies: The CADE-11
; : [Zha93] Zhang (1993), Automated Proofs of Equality Problems in
; Source : [WM88]
; Names : C2 [WM88]
; : Test Problem 17 [Wos88]
; : Sages and Combinatory Logic [Wos88]
; : CADE-11 Competition Eq-8 [Ove90]
; : CL2 [LW92]
; : THEOREM EQ-8 [LM93]
; : Question 3 [Wos93]
; : Question 5 [Wos93]
; : PROBLEM 8 [Zha93]
; Status : unknown
; Rating : 1.00 v2.0.0
; Syntax : Number of clauses : 3 ( 0 non-Horn; 3 unit; 1 RR)
; Number of literals : 3 ( 3 equality)
; Maximal clause size : 1 ( 1 average)
; Number of predicates : 1 ( 0 propositional; 2-2 arity)
; Number of functors : 4 ( 2 constant; 0-2 arity)
; Number of variables : 6 ( 0 singleton)
; Maximal term depth : 4 ( 3 average)
; Comments :
; : tptp2X -f kif -t rm_equality:rstfp COL003-1.p
;--------------------------------------------------------------------------
; b_definition, axiom.
(or (= (apply (apply (apply b ?A) ?B) ?C) (apply ?A (apply ?B ?C))))
; w_definition, axiom.
(or (= (apply (apply w ?A) ?B) (apply (apply ?A ?B) ?B)))
; prove_strong_fixed_point, conjecture.
(or (/= (apply ?A (f ?A)) (apply (f ?A) (apply ?A (f ?A)))))
;--------------------------------------------------------------------------

View file

@ -0,0 +1,52 @@
;--------------------------------------------------------------------------
; File : COL049-1 : TPTP v2.2.0. Released v1.0.0.
; Domain : Combinatory Logic
; Problem : Strong fixed point for B, W, and M
; Version : [WM88] (equality) axioms.
; English : The strong fixed point property holds for the set
; P consisting of the combinators B, W, and M, where ((Bx)y)z
; = x(yz), (Wx)y = (xy)y, Mx = xx.
; Refs : [Smu85] Smullyan (1978), To Mock a Mocking Bird and Other Logi
; : [MW87] McCune & Wos (1987), A Case Study in Automated Theorem
; : [WM88] Wos & McCune (1988), Challenge Problems Focusing on Eq
; : [Ove90] Overbeek (1990), ATP competition announced at CADE-10
; : [LW92] Lusk & Wos (1992), Benchmark Problems in Which Equalit
; : [Wos93] Wos (1993), The Kernel Strategy and Its Use for the St
; : [Ove93] Overbeek (1993), The CADE-11 Competitions: A Personal
; : [LM93] Lusk & McCune (1993), Uniform Strategies: The CADE-11
; : [Zha93] Zhang (1993), Automated Proofs of Equality Problems in
; Source : [Ove90]
; Names : Problem 2 [WM88]
; : CADE-11 Competition Eq-6 [Ove90]
; : CL1 [LW92]
; : THEOREM EQ-6 [LM93]
; : Question 2 [Wos93]
; : PROBLEM 6 [Zha93]
; Status : unsatisfiable
; Rating : 0.22 v2.2.0, 0.14 v2.1.0, 0.62 v2.0.0
; Syntax : Number of clauses : 4 ( 0 non-Horn; 4 unit; 1 RR)
; Number of literals : 4 ( 4 equality)
; Maximal clause size : 1 ( 1 average)
; Number of predicates : 1 ( 0 propositional; 2-2 arity)
; Number of functors : 5 ( 3 constant; 0-2 arity)
; Number of variables : 7 ( 0 singleton)
; Maximal term depth : 4 ( 3 average)
; Comments :
; : tptp2X -f kif -t rm_equality:rstfp COL049-1.p
;--------------------------------------------------------------------------
; b_definition, axiom.
(or (= (apply (apply (apply b ?A) ?B) ?C) (apply ?A (apply ?B ?C))))
; w_definition, axiom.
(or (= (apply (apply w ?A) ?B) (apply (apply ?A ?B) ?B)))
; m_definition, axiom.
(or (= (apply m ?A) (apply ?A ?A)))
; prove_strong_fixed_point, conjecture.
(or (/= (apply ?A (f ?A)) (apply (f ?A) (apply ?A (f ?A)))))
;--------------------------------------------------------------------------

View file

@ -0,0 +1,78 @@
;--------------------------------------------------------------------------
; File : GRP001-1 : TPTP v2.2.0. Released v1.0.0.
; Domain : Group Theory
; Problem : X^2 = identity => commutativity
; Version : [MOW76] axioms.
; English : If the square of every element is the identity, the system
; is commutative.
; Refs : [Rob63] Robinson (1963), Theorem Proving on the Computer
; : [Wos65] Wos (1965), Unpublished Note
; : [MOW76] McCharen et al. (1976), Problems and Experiments for a
; : [WM76] Wilson & Minker (1976), Resolution, Refinements, and S
; : [Ove90] Overbeek (1990), ATP competition announced at CADE-10
; : [Ove93] Overbeek (1993), The CADE-11 Competitions: A Personal
; : [LM93] Lusk & McCune (1993), Uniform Strategies: The CADE-11
; Source : [MOW76]
; Names : - [Rob63]
; : wos10 [WM76]
; : G1 [MOW76]
; : CADE-11 Competition 1 [Ove90]
; : THEOREM 1 [LM93]
; : xsquared.ver1.in [ANL]
; Status : unsatisfiable
; Rating : 0.00 v2.0.0
; Syntax : Number of clauses : 11 ( 0 non-Horn; 8 unit; 5 RR)
; Number of literals : 19 ( 1 equality)
; Maximal clause size : 4 ( 1 average)
; Number of predicates : 2 ( 0 propositional; 2-3 arity)
; Number of functors : 6 ( 4 constant; 0-2 arity)
; Number of variables : 23 ( 0 singleton)
; Maximal term depth : 2 ( 1 average)
; Comments :
; : tptp2X -f kif -t rm_equality:rstfp GRP001-1.p
;--------------------------------------------------------------------------
; left_identity, axiom.
(or (product identity ?A ?A))
; right_identity, axiom.
(or (product ?A identity ?A))
; left_inverse, axiom.
(or (product (inverse ?A) ?A identity))
; right_inverse, axiom.
(or (product ?A (inverse ?A) identity))
; total_function1, axiom.
(or (product ?A ?B (multiply ?A ?B)))
; total_function2, axiom.
(or (not (product ?A ?B ?C))
(not (product ?A ?B ?D))
(= ?C ?D))
; associativity1, axiom.
(or (not (product ?A ?B ?C))
(not (product ?B ?D ?E))
(not (product ?C ?D ?F))
(product ?A ?E ?F))
; associativity2, axiom.
(or (not (product ?A ?B ?C))
(not (product ?B ?D ?E))
(not (product ?A ?E ?F))
(product ?C ?D ?F))
; square_element, hypothesis.
(or (product ?A ?A identity))
; a_times_b_is_c, hypothesis.
(or (product a b c))
; prove_b_times_a_is_c, conjecture.
(or (not (product b a c)))
;--------------------------------------------------------------------------

View file

@ -0,0 +1,98 @@
;--------------------------------------------------------------------------
; File : GRP002-1 : TPTP v2.2.0. Released v1.0.0.
; Domain : Group Theory
; Problem : Commutator equals identity in groups of order 3
; Version : [MOW76] axioms.
; English : In a group, if (for all x) the cube of x is the identity
; (i.e. a group of order 3), then the equation [[x,y],y]=
; identity holds, where [x,y] is the product of x, y, the
; inverse of x and the inverse of y (i.e. the commutator
; of x and y).
; Refs : [MOW76] McCharen et al. (1976), Problems and Experiments for a
; : [OMW76] Overbeek et al. (1976), Complexity and Related Enhance
; : [Wos88] Wos (1988), Automated Reasoning - 33 Basic Research Pr
; : [Ove90] Overbeek (1990), ATP competition announced at CADE-10
; : [Ove93] Overbeek (1993), The CADE-11 Competitions: A Personal
; : [LM93] Lusk & McCune (1993), Uniform Strategies: The CADE-11
; Source : [MOW76]
; Names : G6 [MOW76]
; : Theorem 1 [OMW76]
; : Test Problem 2 [Wos88]
; : Commutator Theorem [Wos88]
; : CADE-11 Competition 2 [Ove90]
; : THEOREM 2 [LM93]
; : commutator.ver1.in [ANL]
; Status : unsatisfiable
; Rating : 0.67 v2.2.0, 0.71 v2.1.0, 1.00 v2.0.0
; Syntax : Number of clauses : 16 ( 0 non-Horn; 11 unit; 11 RR)
; Number of literals : 26 ( 1 equality)
; Maximal clause size : 4 ( 1 average)
; Number of predicates : 2 ( 0 propositional; 2-3 arity)
; Number of functors : 10 ( 8 constant; 0-2 arity)
; Number of variables : 26 ( 0 singleton)
; Maximal term depth : 2 ( 1 average)
; Comments :
; : tptp2X -f kif -t rm_equality:rstfp GRP002-1.p
;--------------------------------------------------------------------------
; left_identity, axiom.
(or (product identity ?A ?A))
; right_identity, axiom.
(or (product ?A identity ?A))
; left_inverse, axiom.
(or (product (inverse ?A) ?A identity))
; right_inverse, axiom.
(or (product ?A (inverse ?A) identity))
; total_function1, axiom.
(or (product ?A ?B (multiply ?A ?B)))
; total_function2, axiom.
(or (not (product ?A ?B ?C))
(not (product ?A ?B ?D))
(= ?C ?D))
; associativity1, axiom.
(or (not (product ?A ?B ?C))
(not (product ?B ?D ?E))
(not (product ?C ?D ?F))
(product ?A ?E ?F))
; associativity2, axiom.
(or (not (product ?A ?B ?C))
(not (product ?B ?D ?E))
(not (product ?A ?E ?F))
(product ?C ?D ?F))
; x_cubed_is_identity_1, hypothesis.
(or (not (product ?A ?A ?B))
(product ?A ?B identity))
; x_cubed_is_identity_2, hypothesis.
(or (not (product ?A ?A ?B))
(product ?B ?A identity))
; a_times_b_is_c, conjecture.
(or (product a b c))
; c_times_inverse_a_is_d, conjecture.
(or (product c (inverse a) d))
; d_times_inverse_b_is_h, conjecture.
(or (product d (inverse b) h))
; h_times_b_is_j, conjecture.
(or (product h b j))
; j_times_inverse_h_is_k, conjecture.
(or (product j (inverse h) k))
; prove_k_times_inverse_b_is_e, conjecture.
(or (not (product k (inverse b) identity)))
;--------------------------------------------------------------------------

View file

@ -0,0 +1,53 @@
;--------------------------------------------------------------------------
; File : GRP002-3 : TPTP v2.2.0. Released v1.0.0.
; Domain : Group Theory
; Problem : Commutator equals identity in groups of order 3
; Version : [Ove90] (equality) axioms : Incomplete.
; English : In a group, if (for all x) the cube of x is the identity
; (i.e. a group of order 3), then the equation [[x,y],y]=
; identity holds, where [x,y] is the product of x, y, the
; inverse of x and the inverse of y (i.e. the commutator
; of x and y).
; Refs : [Ove90] Overbeek (1990), ATP competition announced at CADE-10
; : [Ove93] Overbeek (1993), The CADE-11 Competitions: A Personal
; : [LM93] Lusk & McCune (1993), Uniform Strategies: The CADE-11
; : [Zha93] Zhang (1993), Automated Proofs of Equality Problems in
; Source : [Ove90]
; Names : CADE-11 Competition Eq-1 [Ove90]
; : THEOREM EQ-1 [LM93]
; : PROBLEM 1 [Zha93]
; : comm.in [OTTER]
; Status : unsatisfiable
; Rating : 0.33 v2.2.0, 0.43 v2.1.0, 0.25 v2.0.0
; Syntax : Number of clauses : 6 ( 0 non-Horn; 6 unit; 1 RR)
; Number of literals : 6 ( 6 equality)
; Maximal clause size : 1 ( 1 average)
; Number of predicates : 1 ( 0 propositional; 2-2 arity)
; Number of functors : 6 ( 3 constant; 0-2 arity)
; Number of variables : 8 ( 0 singleton)
; Maximal term depth : 5 ( 2 average)
; Comments : Uses an explicit formulation of the commutator.
; : tptp2X -f kif -t rm_equality:rstfp GRP002-3.p
;--------------------------------------------------------------------------
; left_identity, axiom.
(or (= (multiply identity ?A) ?A))
; left_inverse, axiom.
(or (= (multiply (inverse ?A) ?A) identity))
; associativity, axiom.
(or (= (multiply (multiply ?A ?B) ?C) (multiply ?A (multiply ?B ?C))))
; commutator, axiom.
(or (= (commutator ?A ?B) (multiply ?A (multiply ?B (multiply (inverse ?A) (inverse ?B))))))
; x_cubed_is_identity, hypothesis.
(or (= (multiply ?A (multiply ?A ?A)) identity))
; prove_commutator, conjecture.
(or (/= (commutator (commutator a b) b) identity))
;--------------------------------------------------------------------------

View file

@ -0,0 +1,38 @@
;--------------------------------------------------------------------------
; File : GRP014-1 : TPTP v2.2.0. Released v1.0.0.
; Domain : Group Theory
; Problem : Product is associative in this group theory
; Version : [Ove90] (equality) axioms : Incomplete.
; English : The group theory specified by the axiom given implies the
; associativity of multiply.
; Refs : [Ove90] Overbeek (1990), ATP competition announced at CADE-10
; : [Ove93] Overbeek (1993), The CADE-11 Competitions: A Personal
; : [LM93] Lusk & McCune (1993), Uniform Strategies: The CADE-11
; : [Zha93] Zhang (1993), Automated Proofs of Equality Problems in
; Source : [Ove90]
; Names : CADE-11 Competition Eq-4 [Ove90]
; : THEOREM EQ-4 [LM93]
; : PROBLEM 4 [Zha93]
; Status : unsatisfiable
; Rating : 0.33 v2.2.0, 0.43 v2.1.0, 0.50 v2.0.0
; Syntax : Number of clauses : 2 ( 0 non-Horn; 2 unit; 1 RR)
; Number of literals : 2 ( 2 equality)
; Maximal clause size : 1 ( 1 average)
; Number of predicates : 1 ( 0 propositional; 2-2 arity)
; Number of functors : 5 ( 3 constant; 0-2 arity)
; Number of variables : 4 ( 0 singleton)
; Maximal term depth : 9 ( 4 average)
; Comments : The group_axiom is in fact a single axiom for group theory
; [LM93].
; : tptp2X -f kif -t rm_equality:rstfp GRP014-1.p
;--------------------------------------------------------------------------
; group_axiom, axiom.
(or (= (multiply ?A (inverse (multiply (multiply (inverse (multiply (inverse ?B) (multiply (inverse ?A) ?C))) ?D) (inverse (multiply ?B ?D))))) ?C))
; prove_associativity, conjecture.
(or (/= (multiply a (multiply b c)) (multiply (multiply a b) c)))
;--------------------------------------------------------------------------

View file

@ -0,0 +1,44 @@
;--------------------------------------------------------------------------
; File : LCL024-1 : TPTP v2.2.0. Released v1.0.0.
; Domain : Logic Calculi (Equivalential)
; Problem : PYO depends on XGK
; Version : [Ove90] axioms.
; English : Show that Kalman's shortest single axiom for the
; equivalential calculus, XGK, can be derived from the Meredith
; single axiom PYO.
; Refs : [Wos88] Wos (1988), Automated Reasoning - 33 Basic Research Pr
; : [Ove90] Overbeek (1990), ATP competition announced at CADE-10
; : [Ove93] Overbeek (1993), The CADE-11 Competitions: A Personal
; : [LM93] Lusk & McCune (1993), Uniform Strategies: The CADE-11
; Source : [Ove90]
; Names : Test Problem 16 [Wos88]
; : XGK and Equivalential Calculus [Wos88]
; : CADE-11 Competition 4 [Ove90]
; : THEOREM 4 [LM93]
; Status : unsatisfiable
; Rating : 0.78 v2.2.0, 0.89 v2.1.0, 0.75 v2.0.0
; Syntax : Number of clauses : 3 ( 0 non-Horn; 2 unit; 2 RR)
; Number of literals : 5 ( 0 equality)
; Maximal clause size : 3 ( 1 average)
; Number of predicates : 1 ( 0 propositional; 1-1 arity)
; Number of functors : 4 ( 3 constant; 0-2 arity)
; Number of variables : 5 ( 0 singleton)
; Maximal term depth : 5 ( 2 average)
; Comments :
; : tptp2X -f kif -t rm_equality:rstfp LCL024-1.p
;--------------------------------------------------------------------------
; condensed_detachment, axiom.
(or (not (is_a_theorem (equivalent ?A ?B)))
(not (is_a_theorem ?A))
(is_a_theorem ?B))
; prove_xgk, axiom.
(or (is_a_theorem (equivalent ?A (equivalent (equivalent ?B (equivalent ?C ?A)) (equivalent ?C ?B)))))
; prove_pyo, conjecture.
(or (not (is_a_theorem (equivalent (equivalent (equivalent a (equivalent b c)) c) (equivalent b a)))))
;--------------------------------------------------------------------------

View file

@ -0,0 +1,42 @@
;--------------------------------------------------------------------------
; File : LCL038-1 : TPTP v2.2.0. Released v1.0.0.
; Domain : Logic Calculi (Implication/Falsehood 2 valued sentential)
; Problem : C0-1 depends on a single axiom
; Version : [McC92] axioms.
; English : An axiomatisation for the Implication/Falsehood 2 valued
; sentential calculus is {C0-1,C0-2,C0-3,C0-4}
; by Tarski-Bernays. Show that C0-1 can be derived from this
; suspected single axiom.
; Refs : [Ove90] Overbeek (1990), ATP competition announced at CADE-10
; : [Ove93] Overbeek (1993), The CADE-11 Competitions: A Personal
; : [LM93] Lusk & McCune (1993), Uniform Strategies: The CADE-11
; Source : [Ove90]
; Names : CADE-11 Competition 5 [Ove90]
; : THEOREM 5 [LM93]
; Status : unsatisfiable
; Rating : 0.89 v2.2.0, 1.00 v2.0.0
; Syntax : Number of clauses : 3 ( 0 non-Horn; 2 unit; 2 RR)
; Number of literals : 5 ( 0 equality)
; Maximal clause size : 3 ( 1 average)
; Number of predicates : 1 ( 0 propositional; 1-1 arity)
; Number of functors : 4 ( 3 constant; 0-2 arity)
; Number of variables : 6 ( 2 singleton)
; Maximal term depth : 4 ( 2 average)
; Comments :
; : tptp2X -f kif -t rm_equality:rstfp LCL038-1.p
;--------------------------------------------------------------------------
; condensed_detachment, axiom.
(or (not (is_a_theorem (implies ?A ?B)))
(not (is_a_theorem ?A))
(is_a_theorem ?B))
; single_axiom, axiom.
(or (is_a_theorem (implies (implies (implies ?A ?B) ?C) (implies (implies ?C ?A) (implies ?D ?A)))))
; prove_c0_1, conjecture.
(or (not (is_a_theorem (implies (implies a b) (implies (implies b c) (implies a c))))))
;--------------------------------------------------------------------------

View file

@ -0,0 +1,54 @@
;--------------------------------------------------------------------------
; File : LCL109-2 : TPTP v2.2.0. Released v1.0.0.
; Domain : Logic Calculi (Many valued sentential)
; Problem : MV-4 depends on the Merideth system
; Version : [Ove90] axioms.
; Theorem formulation : Wajsberg algebra formulation.
; English : An axiomatisation of the many valued sentential calculus
; is {MV-1,MV-2,MV-3,MV-5} by Meredith. Wajsberg provided
; a different axiomatisation. Show that MV-4 depends on the
; Wajsberg system.
; Refs : [Ove90] Overbeek (1990), ATP competition announced at CADE-10
; : [LM92] Lusk & McCune (1992), Experiments with ROO, a Parallel
; : [LW92] Lusk & Wos (1992), Benchmark Problems in Which Equalit
; : [Ove93] Overbeek (1993), The CADE-11 Competitions: A Personal
; : [LM93] Lusk & McCune (1993), Uniform Strategies: The CADE-11
; : [Zha93] Zhang (1993), Automated Proofs of Equality Problems in
; Source : [Ove90]
; Names : CADE-11 Competition Eq-5 [Ove90]
; : Luka-5 [LM92]
; : MV4 [LW92]
; : THEOREM EQ-5 [LM93]
; : PROBLEM 5 [Zha93]
; Status : unsatisfiable
; Rating : 0.56 v2.2.0, 0.71 v2.1.0, 1.00 v2.0.0
; Syntax : Number of clauses : 5 ( 0 non-Horn; 5 unit; 1 RR)
; Number of literals : 5 ( 5 equality)
; Maximal clause size : 1 ( 1 average)
; Number of predicates : 1 ( 0 propositional; 2-2 arity)
; Number of functors : 5 ( 3 constant; 0-2 arity)
; Number of variables : 8 ( 0 singleton)
; Maximal term depth : 4 ( 2 average)
; Comments :
; : tptp2X -f kif -t rm_equality:rstfp LCL109-2.p
; ; 'true' renamed to 'true0' - MES
;--------------------------------------------------------------------------
; wajsberg_1, axiom.
(or (= (implies true0 ?A) ?A))
; wajsberg_2, axiom.
(or (= (implies (implies ?A ?B) (implies (implies ?B ?C) (implies ?A ?C))) true0))
; wajsberg_3, axiom.
(or (= (implies (implies ?A ?B) ?B) (implies (implies ?B ?A) ?A)))
; wajsberg_4, axiom.
(or (= (implies (implies (not ?A) (not ?B)) (implies ?B ?A)) true0))
; prove_wajsberg_mv_4, conjecture.
(or (/= (implies (implies (implies a b) (implies b a)) (implies b a)) true0))
;--------------------------------------------------------------------------

View file

@ -0,0 +1,55 @@
%------------------------------------------------------------------------------
% File : LCL111-1 : TPTP v3.0.0. Released v1.0.0.
% Domain : Logic Calculi (Many valued sentential)
% Problem : MV-25 depends on the Merideth system
% Version : [McC92] axioms.
% English : An axiomatisation of the many valued sentential calculus
% is {MV-1,MV-2,MV-3,MV-5} by Meredith. Show that MV-25 depends
% on the Meredith system.
% Refs : [Ove90] Overbeek (1990), ATP competition announced at CADE-10
% : [MW92] McCune & Wos (1992), Experiments in Automated Deductio
% : [McC92] McCune (1992), Email to G. Sutcliffe
% : [Ove93] Overbeek (1993), The CADE-11 Competitions: A Personal
% : [LM93] Lusk & McCune (1993), Uniform Strategies: The CADE-11
% Source : [McC92]
% Names : CADE-11 Competition 6 [Ove90]
% : MV-57 [MW92]
% : THEOREM 6 [LM93]
% : mv.in part 2 [OTTER]
% : mv25.in [OTTER]
% : ovb6 [SETHEO]
% Status : Unsatisfiable
% Rating : 0.00 v2.4.0, 0.43 v2.3.0, 0.14 v2.2.1, 0.11 v2.2.0, 0.22 v2.1.0, 0.25 v2.0.0
% Syntax : Number of clauses : 6 ( 0 non-Horn; 5 unit; 2 RR)
% Number of atoms : 8 ( 0 equality)
% Maximal clause size : 3 ( 1 average)
% Number of predicates : 1 ( 0 propositional; 1-1 arity)
% Number of functors : 5 ( 3 constant; 0-2 arity)
% Number of variables : 11 ( 1 singleton)
% Maximal term depth : 4 ( 3 average)
% Comments :
% : tptp2X -f tptp:short LCL111-1.p
%------------------------------------------------------------------------------
cnf(condensed_detachment,axiom,(
~ is_a_theorem(implies(X,Y))
| ~ is_a_theorem(X)
| is_a_theorem(Y) )).
cnf(mv_1,axiom,(
is_a_theorem(implies(X,implies(Y,X))) )).
cnf(mv_2,axiom,(
is_a_theorem(implies(implies(X,Y),implies(implies(Y,Z),implies(X,Z)))) )).
cnf(mv_3,axiom,(
is_a_theorem(implies(implies(implies(X,Y),Y),implies(implies(Y,X),X))) )).
cnf(mv_5,axiom,(
is_a_theorem(implies(implies(not(X),not(Y)),implies(Y,X))) )).
cnf(prove_mv_25,negated_conjecture,(
~ is_a_theorem(implies(implies(a,b),implies(implies(c,a),implies(c,b)))) )).
%------------------------------------------------------------------------------

View file

@ -0,0 +1,53 @@
;--------------------------------------------------------------------------
; File : LCL114-1 : TPTP v2.2.0. Released v1.0.0.
; Domain : Logic Calculi (Many valued sentential)
; Problem : MV-36 depnds on the Merideth system
; Version : [McC92] axioms.
; English : An axiomatisation of the many valued sentential calculus
; is {MV-1,MV-2,MV-3,MV-5} by Meredith. Show that 36 depends
; on the Meredith system.
; Refs : [Ove90] Overbeek (1990), ATP competition announced at CADE-10
; : [MW92] McCune & Wos (1992), Experiments in Automated Deductio
; : [McC92] McCune (1992), Email to G. Sutcliffe
; : [Ove93] Overbeek (1993), The CADE-11 Competitions: A Personal
; : [LM93] Lusk & McCune (1993), Uniform Strategies: The CADE-11
; Source : [McC92]
; Names : CADE-11 Competition 7 [Ove90]
; : MV-60 [MW92]
; : THEOREM 7 [LM93]
; Status : unsatisfiable
; Rating : 0.89 v2.1.0, 0.88 v2.0.0
; Syntax : Number of clauses : 6 ( 0 non-Horn; 5 unit; 2 RR)
; Number of literals : 8 ( 0 equality)
; Maximal clause size : 3 ( 1 average)
; Number of predicates : 1 ( 0 propositional; 1-1 arity)
; Number of functors : 4 ( 2 constant; 0-2 arity)
; Number of variables : 11 ( 1 singleton)
; Maximal term depth : 4 ( 2 average)
; Comments :
; : tptp2X -f kif -t rm_equality:rstfp LCL114-1.p
;--------------------------------------------------------------------------
; condensed_detachment, axiom.
(or (not (is_a_theorem (implies ?A ?B)))
(not (is_a_theorem ?A))
(is_a_theorem ?B))
; mv_1, axiom.
(or (is_a_theorem (implies ?A (implies ?B ?A))))
; mv_2, axiom.
(or (is_a_theorem (implies (implies ?A ?B) (implies (implies ?B ?C) (implies ?A ?C)))))
; mv_3, axiom.
(or (is_a_theorem (implies (implies (implies ?A ?B) ?B) (implies (implies ?B ?A) ?A))))
; mv_5, axiom.
(or (is_a_theorem (implies (implies (not ?A) (not ?B)) (implies ?B ?A))))
; prove_mv_36, conjecture.
(or (not (is_a_theorem (implies (implies a b) (implies (not b) (not a))))))
;--------------------------------------------------------------------------

View file

@ -0,0 +1,155 @@
;--------------------------------------------------------------------------
; File : PUZ031+1 : TPTP v2.2.0. Released v2.0.0.
; Domain : Puzzles
; Problem : Schubert's Steamroller
; Version : Especial.
; English : Wolves, foxes, birds, caterpillars, and snails are animals, and
; there are some of each of them. Also there are some grains, and
; grains are plants. Every animal either likes to eat all plants
; or all animals much smaller than itself that like to eat some
; plants. Caterpillars and snails are much smaller than birds,
; which are much smaller than foxes, which in turn are much
; smaller than wolves. Wolves do not like to eat foxes or grains,
; while birds like to eat caterpillars but not snails.
; Caterpillars and snails like to eat some plants. Therefore
; there is an animal that likes to eat a grain eating animal.
; Refs : [Pel86] Pelletier (1986), Seventy-five Problems for Testing Au
; : [Hah94] Haehnle (1994), Email to G. Sutcliffe
; Source : [Hah94]
; Names : Pelletier 47 [Pel86]
; Status : theorem
; Rating : 0.00 v2.1.0
; Syntax : Number of formulae : 21 ( 6 unit)
; Number of atoms : 55 ( 0 equality)
; Maximal formula depth : 9 ( 3 average)
; Number of connectives : 36 ( 2 ~ ; 4 |; 14 &)
; ( 0 <=>; 16 =>; 0 <=)
; ( 0 <~>; 0 ~|; 0 ~&)
; Number of predicates : 10 ( 0 propositional; 1-2 arity)
; Number of functors : 0 ( 0 constant; --- arity)
; Number of variables : 33 ( 0 singleton; 22 !; 11 ?)
; Maximal term depth : 1 ( 1 average)
; Comments : This problem is named after Len Schubert.
; : tptp2X -f kif PUZ031+1.p
;--------------------------------------------------------------------------
; pel47_1_1, axiom.
(forall (?A)
(=> (wolf ?A)
(animal ?A) ) )
; pel47_1_2, axiom.
(exists (?A)(wolf ?A) )
; pel47_2_1, axiom.
(forall (?A)
(=> (fox ?A)
(animal ?A) ) )
; pel47_2_2, axiom.
(exists (?A)(fox ?A) )
; pel47_3_1, axiom.
(forall (?A)
(=> (bird ?A)
(animal ?A) ) )
; pel47_3_2, axiom.
(exists (?A)(bird ?A) )
; pel47_4_1, axiom.
(forall (?A)
(=> (caterpillar ?A)
(animal ?A) ) )
; pel47_4_2, axiom.
(exists (?A)(caterpillar ?A) )
; pel47_5_1, axiom.
(forall (?A)
(=> (snail ?A)
(animal ?A) ) )
; pel47_5_2, axiom.
(exists (?A)(snail ?A) )
; pel47_6_1, axiom.
(exists (?A)(grain ?A) )
; pel47_6_2, axiom.
(forall (?A)
(=> (grain ?A)
(plant ?A) ) )
; pel47_7, axiom.
(forall (?A)
(=> (animal ?A)
(or (forall (?B)
(=> (plant ?B)
(eats ?A ?B) ) )
(forall (?C)
(=> (and (and (animal ?C)
(much_smaller ?C ?A) )
(exists (?D)
(and (plant ?D)
(eats ?C ?D) ) ) )
(eats ?A ?C) ) ) ) ) )
; pel47_8, axiom.
(forall (?A ?B)
(=> (and (bird ?B)
(or (snail ?A)
(caterpillar ?A) ) )
(much_smaller ?A ?B) ) )
; pel47_9, axiom.
(forall (?A ?B)
(=> (and (bird ?A)
(fox ?B) )
(much_smaller ?A ?B) ) )
; pel47_10, axiom.
(forall (?A ?B)
(=> (and (fox ?A)
(wolf ?B) )
(much_smaller ?A ?B) ) )
; pel47_11, axiom.
(forall (?A ?B)
(=> (and (wolf ?A)
(or (fox ?B)
(grain ?B) ) )
(not (eats ?A ?B) ) ) )
; pel47_12, axiom.
(forall (?A ?B)
(=> (and (bird ?A)
(caterpillar ?B) )
(eats ?A ?B) ) )
; pel47_13, axiom.
(forall (?A ?B)
(=> (and (bird ?A)
(snail ?B) )
(not (eats ?A ?B) ) ) )
; pel47_14, axiom.
(forall (?A)
(=> (or (caterpillar ?A)
(snail ?A) )
(exists (?B)
(and (plant ?B)
(eats ?A ?B) ) ) ) )
; pel47, conjecture.
(not (exists (?A ?B)
(and (and (animal ?A)
(animal ?B) )
(exists (?C)
(and (and (grain ?C)
(eats ?B ?C) )
(eats ?A ?B) ) ) ) ) )
;--------------------------------------------------------------------------

View file

@ -0,0 +1,129 @@
;--------------------------------------------------------------------------
; File : RNG008-6 : TPTP v2.2.0. Released v1.0.0.
; Domain : Ring Theory
; Problem : Boolean rings are commutative
; Version : [MOW76] axioms : Augmented.
; English : Given a ring in which for all x, x * x = x, prove that for
; all x and y, x * y = y * x.
; Refs : [MOW76] McCharen et al. (1976), Problems and Experiments for a
; : [Ove90] Overbeek (1990), ATP competition announced at CADE-10
; : [Ove93] Overbeek (1993), The CADE-11 Competitions: A Personal
; : [LM93] Lusk & McCune (1993), Uniform Strategies: The CADE-11
; Source : [Ove90]
; Names : CADE-11 Competition 3 [Ove90]
; : THEOREM 3 [LM93]
; Status : unsatisfiable
; Rating : 0.67 v2.2.0, 0.71 v2.1.0, 0.75 v2.0.0
; Syntax : Number of clauses : 22 ( 0 non-Horn; 11 unit; 13 RR)
; Number of literals : 55 ( 2 equality)
; Maximal clause size : 5 ( 2 average)
; Number of predicates : 3 ( 0 propositional; 2-3 arity)
; Number of functors : 7 ( 4 constant; 0-2 arity)
; Number of variables : 74 ( 2 singleton)
; Maximal term depth : 2 ( 1 average)
; Comments : Supplies multiplication to identity as lemmas
; : tptp2X -f kif -t rm_equality:rstfp RNG008-6.p
;--------------------------------------------------------------------------
; additive_identity1, axiom.
(or (sum additive_identity ?A ?A))
; additive_identity2, axiom.
(or (sum ?A additive_identity ?A))
; closure_of_multiplication, axiom.
(or (product ?A ?B (multiply ?A ?B)))
; closure_of_addition, axiom.
(or (sum ?A ?B (add ?A ?B)))
; left_inverse, axiom.
(or (sum (additive_inverse ?A) ?A additive_identity))
; right_inverse, axiom.
(or (sum ?A (additive_inverse ?A) additive_identity))
; associativity_of_addition1, axiom.
(or (not (sum ?A ?B ?C))
(not (sum ?B ?D ?E))
(not (sum ?C ?D ?F))
(sum ?A ?E ?F))
; associativity_of_addition2, axiom.
(or (not (sum ?A ?B ?C))
(not (sum ?B ?D ?E))
(not (sum ?A ?E ?F))
(sum ?C ?D ?F))
; commutativity_of_addition, axiom.
(or (not (sum ?A ?B ?C))
(sum ?B ?A ?C))
; associativity_of_multiplication1, axiom.
(or (not (product ?A ?B ?C))
(not (product ?B ?D ?E))
(not (product ?C ?D ?F))
(product ?A ?E ?F))
; associativity_of_multiplication2, axiom.
(or (not (product ?A ?B ?C))
(not (product ?B ?D ?E))
(not (product ?A ?E ?F))
(product ?C ?D ?F))
; distributivity1, axiom.
(or (not (product ?A ?B ?C))
(not (product ?A ?D ?E))
(not (sum ?B ?D ?F))
(not (product ?A ?F ?G))
(sum ?C ?E ?G))
; distributivity2, axiom.
(or (not (product ?A ?B ?C))
(not (product ?A ?D ?E))
(not (sum ?B ?D ?F))
(not (sum ?C ?E ?G))
(product ?A ?F ?G))
; distributivity3, axiom.
(or (not (product ?A ?B ?C))
(not (product ?D ?B ?E))
(not (sum ?A ?D ?F))
(not (product ?F ?B ?G))
(sum ?C ?E ?G))
; distributivity4, axiom.
(or (not (product ?A ?B ?C))
(not (product ?D ?B ?E))
(not (sum ?A ?D ?F))
(not (sum ?C ?E ?G))
(product ?F ?B ?G))
; addition_is_well_defined, axiom.
(or (not (sum ?A ?B ?C))
(not (sum ?A ?B ?D))
(= ?C ?D))
; multiplication_is_well_defined, axiom.
(or (not (product ?A ?B ?C))
(not (product ?A ?B ?D))
(= ?C ?D))
; x_times_identity_x_is_identity, axiom.
(or (product ?A additive_identity additive_identity))
; identity_times_x_is_identity, axiom.
(or (product additive_identity ?A additive_identity))
; x_squared_is_x, hypothesis.
(or (product ?A ?A ?A))
; a_times_b_is_c, hypothesis.
(or (product a b c))
; prove_b_times_a_is_c, conjecture.
(or (not (product b a c)))
;--------------------------------------------------------------------------

View file

@ -0,0 +1,60 @@
;--------------------------------------------------------------------------
; File : RNG009-5 : TPTP v2.2.0. Released v1.0.0.
; Domain : Ring Theory
; Problem : If X*X*X = X then the ring is commutative
; Version : [Peterson & Stickel,1981] (equality) axioms :
; Reduced > Incomplete.
; English : Given a ring in which for all x, x * x * x = x, prove that
; for all x and y, x * y = y * x.
; Refs : [PS81] Peterson & Stickel (1981), Complete Sets of Reductions
; : [Ove90] Overbeek (1990), ATP competition announced at CADE-10
; : [Ove93] Overbeek (1993), The CADE-11 Competitions: A Personal
; : [LM93] Lusk & McCune (1993), Uniform Strategies: The CADE-11
; : [Zha93] Zhang (1993), Automated Proofs of Equality Problems in
; Source : [Ove90]
; Names : CADE-11 Competition Eq-7 [Ove90]
; : THEOREM EQ-7 [LM93]
; : PROBLEM 7 [Zha93]
; Status : unsatisfiable
; Rating : 0.67 v2.2.0, 0.71 v2.1.0, 1.00 v2.0.0
; Syntax : Number of clauses : 9 ( 0 non-Horn; 9 unit; 1 RR)
; Number of literals : 9 ( 9 equality)
; Maximal clause size : 1 ( 1 average)
; Number of predicates : 1 ( 0 propositional; 2-2 arity)
; Number of functors : 6 ( 3 constant; 0-2 arity)
; Number of variables : 17 ( 0 singleton)
; Maximal term depth : 3 ( 2 average)
; Comments :
; : tptp2X -f kif -t rm_equality:rstfp RNG009-5.p
;--------------------------------------------------------------------------
; right_identity, axiom.
(or (= (add ?A additive_identity) ?A))
; right_additive_inverse, axiom.
(or (= (add ?A (additive_inverse ?A)) additive_identity))
; distribute1, axiom.
(or (= (multiply ?A (add ?B ?C)) (add (multiply ?A ?B) (multiply ?A ?C))))
; distribute2, axiom.
(or (= (multiply (add ?A ?B) ?C) (add (multiply ?A ?C) (multiply ?B ?C))))
; associative_addition, axiom.
(or (= (add (add ?A ?B) ?C) (add ?A (add ?B ?C))))
; commutative_addition, axiom.
(or (= (add ?A ?B) (add ?B ?A)))
; associative_multiplication, axiom.
(or (= (multiply (multiply ?A ?B) ?C) (multiply ?A (multiply ?B ?C))))
; x_cubed_is_x, hypothesis.
(or (= (multiply ?A (multiply ?A ?A)) ?A))
; prove_commutativity, conjecture.
(or (/= (multiply a b) (multiply b a)))
;--------------------------------------------------------------------------

View file

@ -0,0 +1,117 @@
;--------------------------------------------------------------------------
; File : RNG010-5 : TPTP v2.2.0. Released v1.0.0.
; Domain : Ring Theory (Right alternative)
; Problem : Skew symmetry of the auxilliary function
; Version : [Ove90] (equality) axioms :
; Incomplete > Augmented > Incomplete.
; English : The three Moufang identities imply the skew symmetry
; of s(W,X,Y,Z) = (W*X,Y,Z) - X*(W,Y,Z) - (X,Y,Z)*W.
; Recall that skew symmetry means that the function sign
; changes when any two arguments are swapped. This problem
; proves the case for swapping the first two arguments.
; Refs : [Ove90] Overbeek (1990), ATP competition announced at CADE-10
; : [Ove93] Overbeek (1993), The CADE-11 Competitions: A Personal
; : [LM93] Lusk & McCune (1993), Uniform Strategies: The CADE-11
; : [Zha93] Zhang (1993), Automated Proofs of Equality Problems in
; Source : [Ove90]
; Names : CADE-11 Competition Eq-9 [Ove90]
; : THEOREM EQ-9 [LM93]
; : PROBLEM 9 [Zha93]
; Status : unknown
; Rating : 1.00 v2.0.0
; Syntax : Number of clauses : 27 ( 0 non-Horn; 27 unit; 2 RR)
; Number of literals : 27 ( 27 equality)
; Maximal clause size : 1 ( 1 average)
; Number of predicates : 1 ( 0 propositional; 2-2 arity)
; Number of functors : 11 ( 5 constant; 0-4 arity)
; Number of variables : 52 ( 2 singleton)
; Maximal term depth : 6 ( 2 average)
; Comments : I copied this directly. I think the Moufang identities may
; be wrong. At least they're in another form.
; : tptp2X -f kif -t rm_equality:rstfp RNG010-5.p
;--------------------------------------------------------------------------
; commutative_addition, axiom.
(or (= (add ?A ?B) (add ?B ?A)))
; associative_addition, axiom.
(or (= (add (add ?A ?B) ?C) (add ?A (add ?B ?C))))
; right_identity, axiom.
(or (= (add ?A additive_identity) ?A))
; left_identity, axiom.
(or (= (add additive_identity ?A) ?A))
; right_additive_inverse, axiom.
(or (= (add ?A (additive_inverse ?A)) additive_identity))
; left_additive_inverse, axiom.
(or (= (add (additive_inverse ?A) ?A) additive_identity))
; additive_inverse_identity, axiom.
(or (= (additive_inverse additive_identity) additive_identity))
; property_of_inverse_and_add, axiom.
(or (= (add ?A (add (additive_inverse ?A) ?B)) ?B))
; distribute_additive_inverse, axiom.
(or (= (additive_inverse (add ?A ?B)) (add (additive_inverse ?A) (additive_inverse ?B))))
; additive_inverse_additive_inverse, axiom.
(or (= (additive_inverse (additive_inverse ?A)) ?A))
; multiply_additive_id1, axiom.
(or (= (multiply ?A additive_identity) additive_identity))
; multiply_additive_id2, axiom.
(or (= (multiply additive_identity ?A) additive_identity))
; product_of_inverse, axiom.
(or (= (multiply (additive_inverse ?A) (additive_inverse ?B)) (multiply ?A ?B)))
; multiply_additive_inverse1, axiom.
(or (= (multiply ?A (additive_inverse ?B)) (additive_inverse (multiply ?A ?B))))
; multiply_additive_inverse2, axiom.
(or (= (multiply (additive_inverse ?A) ?B) (additive_inverse (multiply ?A ?B))))
; distribute1, axiom.
(or (= (multiply ?A (add ?B ?C)) (add (multiply ?A ?B) (multiply ?A ?C))))
; distribute2, axiom.
(or (= (multiply (add ?A ?B) ?C) (add (multiply ?A ?C) (multiply ?B ?C))))
; right_alternative, axiom.
(or (= (multiply (multiply ?A ?B) ?B) (multiply ?A (multiply ?B ?B))))
; associator, axiom.
(or (= (associator ?A ?B ?C) (add (multiply (multiply ?A ?B) ?C) (additive_inverse (multiply ?A (multiply ?B ?C))))))
; commutator, axiom.
(or (= (commutator ?A ?B) (add (multiply ?B ?A) (additive_inverse (multiply ?A ?B)))))
; middle_associator, axiom.
(or (= (multiply (multiply (associator ?A ?A ?B) ?A) (associator ?A ?A ?B)) additive_identity))
; left_alternative, axiom.
(or (= (multiply (multiply ?A ?A) ?B) (multiply ?A (multiply ?A ?B))))
; defines_s, axiom.
(or (= (s ?A ?B ?C ?D) (add (add (associator (multiply ?A ?B) ?C ?D) (additive_inverse (multiply ?B (associator ?A ?C ?D)))) (additive_inverse (multiply (associator ?B ?C ?D) ?A)))))
; right_moufang, hypothesis.
(or (= (multiply ?A (multiply ?B (multiply ?C ?B))) (multiply (commutator (multiply ?A ?B) ?C) ?B)))
; left_moufang, hypothesis.
(or (= (multiply (multiply ?A (multiply ?B ?A)) ?C) (multiply ?A (commutator ?B (multiply ?A ?C)))))
; middle_moufang, hypothesis.
(or (= (multiply (multiply ?A ?B) (multiply ?C ?A)) (multiply (multiply ?A (multiply ?B ?C)) ?A)))
; prove_skew_symmetry, conjecture.
(or (/= (s a b c d) (additive_inverse (s b a c d))))
;--------------------------------------------------------------------------

View file

@ -0,0 +1,97 @@
;--------------------------------------------------------------------------
; File : RNG011-5 : TPTP v2.2.0. Released v1.0.0.
; Domain : Ring Theory
; Problem : In a right alternative ring (((X,X,Y)*X)*(X,X,Y)) = Add Id
; Version : [Ove90] (equality) axioms :
; Incomplete > Augmented > Incomplete.
; English :
; Refs : [Ove90] Overbeek (1990), ATP competition announced at CADE-10
; : [Ove93] Overbeek (1993), The CADE-11 Competitions: A Personal
; : [LM93] Lusk & McCune (1993), Uniform Strategies: The CADE-11
; : [Zha93] Zhang (1993), Automated Proofs of Equality Problems in
; Source : [Ove90]
; Names : CADE-11 Competition Eq-10 [Ove90]
; : THEOREM EQ-10 [LM93]
; : PROBLEM 10 [Zha93]
; Status : unsatisfiable
; Rating : 0.00 v2.0.0
; Syntax : Number of clauses : 22 ( 0 non-Horn; 22 unit; 2 RR)
; Number of literals : 22 ( 22 equality)
; Maximal clause size : 1 ( 1 average)
; Number of predicates : 1 ( 0 propositional; 2-2 arity)
; Number of functors : 8 ( 3 constant; 0-3 arity)
; Number of variables : 37 ( 2 singleton)
; Maximal term depth : 5 ( 2 average)
; Comments :
; : tptp2X -f kif -t rm_equality:rstfp RNG011-5.p
;--------------------------------------------------------------------------
; commutative_addition, axiom.
(or (= (add ?A ?B) (add ?B ?A)))
; associative_addition, axiom.
(or (= (add (add ?A ?B) ?C) (add ?A (add ?B ?C))))
; right_identity, axiom.
(or (= (add ?A additive_identity) ?A))
; left_identity, axiom.
(or (= (add additive_identity ?A) ?A))
; right_additive_inverse, axiom.
(or (= (add ?A (additive_inverse ?A)) additive_identity))
; left_additive_inverse, axiom.
(or (= (add (additive_inverse ?A) ?A) additive_identity))
; additive_inverse_identity, axiom.
(or (= (additive_inverse additive_identity) additive_identity))
; property_of_inverse_and_add, axiom.
(or (= (add ?A (add (additive_inverse ?A) ?B)) ?B))
; distribute_additive_inverse, axiom.
(or (= (additive_inverse (add ?A ?B)) (add (additive_inverse ?A) (additive_inverse ?B))))
; additive_inverse_additive_inverse, axiom.
(or (= (additive_inverse (additive_inverse ?A)) ?A))
; multiply_additive_id1, axiom.
(or (= (multiply ?A additive_identity) additive_identity))
; multiply_additive_id2, axiom.
(or (= (multiply additive_identity ?A) additive_identity))
; product_of_inverse, axiom.
(or (= (multiply (additive_inverse ?A) (additive_inverse ?B)) (multiply ?A ?B)))
; multiply_additive_inverse1, axiom.
(or (= (multiply ?A (additive_inverse ?B)) (additive_inverse (multiply ?A ?B))))
; multiply_additive_inverse2, axiom.
(or (= (multiply (additive_inverse ?A) ?B) (additive_inverse (multiply ?A ?B))))
; distribute1, axiom.
(or (= (multiply ?A (add ?B ?C)) (add (multiply ?A ?B) (multiply ?A ?C))))
; distribute2, axiom.
(or (= (multiply (add ?A ?B) ?C) (add (multiply ?A ?C) (multiply ?B ?C))))
; right_alternative, axiom.
(or (= (multiply (multiply ?A ?B) ?B) (multiply ?A (multiply ?B ?B))))
; associator, axiom.
(or (= (associator ?A ?B ?C) (add (multiply (multiply ?A ?B) ?C) (additive_inverse (multiply ?A (multiply ?B ?C))))))
; commutator, axiom.
(or (= (commutator ?A ?B) (add (multiply ?B ?A) (additive_inverse (multiply ?A ?B)))))
; middle_associator, axiom.
(or (= (multiply (multiply (associator ?A ?A ?B) ?A) (associator ?A ?A ?B)) additive_identity))
; prove_equality, conjecture.
(or (/= (multiply (multiply (associator a a b) a) (associator a a b)) additive_identity))
;--------------------------------------------------------------------------

View file

@ -0,0 +1,53 @@
;--------------------------------------------------------------------------
; File : ROB005-1 : TPTP v2.2.0. Released v1.0.0.
; Domain : Robbins Algebra
; Problem : c + c=c => Boolean
; Version : [Win90] (equality) axioms.
; English : If there is an element c such that c+c=c, then the algebra
; is Boolean.
; Refs : [HMT71] Henkin et al. (1971), Cylindrical Algebras
; : [Win90] Winker (1990), Robbins Algebra: Conditions that make a
; : [Ove90] Overbeek (1990), ATP competition announced at CADE-10
; : [LW92] Lusk & Wos (1992), Benchmark Problems in Which Equalit
; : [Ove93] Overbeek (1993), The CADE-11 Competitions: A Personal
; : [LM93] Lusk & McCune (1993), Uniform Strategies: The CADE-11
; : [Zha93] Zhang (1993), Automated Proofs of Equality Problems in
; Source : [Ove90]
; Names : CADE-11 Competition Eq-2 [Ove90]
; : Lemma 2.4 [Win90]
; : RA3 [LW92]
; : THEOREM EQ-2 [LM93]
; : PROBLEM 2 [Zha93]
; : robbins.occ.in [OTTER]
; Status : unsatisfiable
; Rating : 0.67 v2.2.0, 0.71 v2.1.0, 0.88 v2.0.0
; Syntax : Number of clauses : 5 ( 0 non-Horn; 5 unit; 2 RR)
; Number of literals : 5 ( 5 equality)
; Maximal clause size : 1 ( 1 average)
; Number of predicates : 1 ( 0 propositional; 2-2 arity)
; Number of functors : 5 ( 3 constant; 0-2 arity)
; Number of variables : 7 ( 0 singleton)
; Maximal term depth : 6 ( 2 average)
; Comments : Commutativity, associativity, and Huntington's axiom
; axiomatize Boolean algebra.
; : tptp2X -f kif -t rm_equality:rstfp ROB005-1.p
;--------------------------------------------------------------------------
; commutativity_of_add, axiom.
(or (= (add ?A ?B) (add ?B ?A)))
; associativity_of_add, axiom.
(or (= (add (add ?A ?B) ?C) (add ?A (add ?B ?C))))
; robbins_axiom, axiom.
(or (= (negate (add (negate (add ?A ?B)) (negate (add ?A (negate ?B))))) ?A))
; idempotence, hypothesis.
(or (= (add c c) c))
; prove_huntingtons_axiom, conjecture.
(or (/= (add (negate (add a (negate b))) (negate (add (negate a) (negate b)))) b))
;--------------------------------------------------------------------------

Binary file not shown.

View file

@ -0,0 +1,362 @@
;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: snark-user -*-
;;; File: coder-examples.lisp
;;; The contents of this file are subject to the Mozilla Public License
;;; Version 1.1 (the "License"); you may not use this file except in
;;; compliance with the License. You may obtain a copy of the License at
;;; http://www.mozilla.org/MPL/
;;;
;;; Software distributed under the License is distributed on an "AS IS"
;;; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
;;; License for the specific language governing rights and limitations
;;; under the License.
;;;
;;; The Original Code is SNARK.
;;; The Initial Developer of the Original Code is SRI International.
;;; Portions created by the Initial Developer are Copyright (C) 1981-2004.
;;; All Rights Reserved.
;;;
;;; Contributor(s): Mark E. Stickel <stickel@ai.sri.com>.
(in-package :snark-user)
(defun coder-test ()
(time (coder-overbeek6))
(time (coder-ycl-rst))
(time (coder-ycl-rst-together))
(time (coder-veroff-5-2))
(time (coder-veroff-4-1 :all-proofs t))
(time (coder-ex7b))
(time (coder-ex9 :max-syms 18 :max-vars 2))
nil)
(defun coder-xcb-reflex (&rest options)
;; 10-step proof
;; 11-step proof by (coder-xcb-reflex :max-syms 35)
;; 13-step proof by (coder-xcb-reflex :max-syms 31)
(apply
'coder
'((e ?x (e (e (e ?x ?y) (e ?z ?y)) ?z)))
'(e a a)
options))
(defun coder-overbeek6 (&rest options)
;; 5-step proof
(apply
'coder
'("i(a,i(b,a))" ;Prolog style with declared variables
"i(i(X,Y),i(i(Y,?z),i(X,?z)))" ;Prolog style with explicit variables (capitalized-or ?-prefix)
(i (i (i a b) b) (i (i b a) a)) ;Lisp style with declared variables
(i (i (n ?x) (n ?y)) (i ?y ?x))) ;Lisp style with explicit variables
"i(i(a,b),i(i(c,a),i(c,b)))" ;variable declarations don't apply to target
:variables '(a b c)
options))
(defun coder-overbeek4 (&rest options)
;; 10-step proof
(apply
'coder
'((e ?x (e (e ?y (e ?z ?x)) (e ?z ?y))))
'(e (e (e a (e b c)) c) (e b a))
options))
(defun coder-ycl-rst (&rest options)
;; prove reflexivity (4-step proof),
;; symmetry (5-step proof),
;; and transitivity (6-step proof) from ycl
;; coder searches until all have been found
(apply
'coder
'((e (e ?x ?y) (e (e ?z ?y) (e ?x ?z))))
'(and
(e a a)
(e (e a b) (e b a))
(e (e a b) (e (e b c) (e a c))))
options))
(defun coder-ycl-rst-together (&rest options)
;; prove reflexivity, symmetry, and transitivity from ycl in a single derivation
;; 9-step proof
(apply
'coder
'((e (e ?x ?y) (e (e ?z ?y) (e ?x ?z))))
'(together
(e a a)
(e (e a b) (e b a))
(e (e a b) (e (e b c) (e a c))))
options))
(defun coder-veroff-5-2 (&rest options)
;; problem from
;; Robert Veroff, "Finding Shortest Proofs: An Application of Linked Inference Rules",
;; JAR 27,2 (August 2001), 123-129
;; 8-step proof
(apply
'coder
'((i ?x (i ?y ?x))
(i (i ?x (i ?y ?z)) (i (i ?x ?y) (i ?x ?z))))
'(i (i a (i b c)) (i b (i a c)))
options))
(defun coder-veroff-4-1 (&rest options)
;; converse (because there's a typo) of problem from
;; Robert Veroff, "Finding Shortest Proofs: An Application of Linked Inference Rules",
;; JAR 27,2 (August 2001), 123-129
;; 7 6-step proofs, just like Veroff reported
(apply
'coder
'((i (i (i ?v1 ?v2) ?v3) (i (i ?v2 (i ?v3 ?v5)) (i ?v4 (i ?v2 ?v5)))))
'(i (i v2 (i v3 v5)) (i (i (i v1 v2) v3) (i v4 (i v2 v5))))
options))
(defun ii-schema ()
'(i ?x (i ?y ?x)))
(defun id-schema ()
'(i (i ?x (i ?y ?z)) (i (i ?x ?y) (i ?x ?z))))
(defun cr-schema1 ()
'(i (i ?x (n ?y)) (i (i ?x ?y) (n ?x))))
(defun cr-schema2 ()
'(i (i (n ?x) (n ?y)) (i (i (n ?x) ?y) ?x)))
(defun eq-schema1 ()
'(i (e ?x ?y) (i ?x ?y)))
(defun eq-schema2 ()
'(i (e ?x ?y) (i ?y ?x)))
(defun eq-schema3 ()
'(i (i ?x ?y) (i (i ?y ?x) (e ?y ?x))))
(defun or-schema ()
'(e (o ?x ?y) (i (n ?x) ?y)))
(defun and-schema ()
'(e (a ?x ?y) (n (o (n ?x) (n ?y)))))
(defun alt-and-schema ()
'(e (a ?x ?y) (n (i ?x (n ?y)))))
(defun coder-ex1 (&rest options)
;; from Genesereth chapter 4
;; 3-step proof
(apply
'coder
(list (ii-schema)
(id-schema)
'(i p q)
'(i q r))
'(i p r)
options))
(defun coder-ex2 (&rest options)
;; from Genesereth chapter 4 exercise
;; 6-step proof
(apply
'coder
(list (ii-schema)
(id-schema)
(cr-schema1)
(cr-schema2)
'(i p q)
'(i q r))
'(i (i p (n r)) (n p))
options))
(defun coder-ex3 (&rest options)
;; from Genesereth chapter 4 exercise
;; 5-step proof
(apply
'coder
(list (ii-schema)
(id-schema)
(cr-schema1)
(cr-schema2)
'(n (n p)))
'p
options))
(defun coder-ex4 (&rest options)
;; 5-step proof
(apply
'coder
(list (ii-schema)
(id-schema)
(cr-schema1)
(cr-schema2)
'p)
'(n (n p))
options))
(defun coder-ex5 (&rest options)
;; 4-step proof
(apply
'coder
(list (ii-schema)
(id-schema)
(cr-schema1)
(cr-schema2)
(eq-schema1)
(eq-schema2)
(eq-schema3))
'(e p p)
options))
(defun coder-ex6 (&rest options)
;; 4-step proof
(apply
'coder
(list (ii-schema)
(id-schema)
(cr-schema1)
(cr-schema2)
(eq-schema1)
(eq-schema2)
(eq-schema3)
'(e p q))
'(e q p)
options))
(defun coder-ex6a (&rest options)
;; 5-step proof
(apply
'coder
(list (ii-schema)
(id-schema)
(cr-schema1)
(cr-schema2)
(eq-schema1)
(eq-schema2)
(eq-schema3))
'(i (e p q) (e q p))
options))
(defun coder-ex6b (&rest options)
;; 7-step proof
(apply
'coder
(list (ii-schema)
(id-schema)
(cr-schema1)
(cr-schema2)
(eq-schema1)
(eq-schema2)
(eq-schema3))
'(e (e p q) (e q p))
options))
(defun coder-ex7a ()
;; 5-step proof, 5-step proof, 2-step proof
(coder (list (ii-schema)
(id-schema)
(eq-schema1)
(eq-schema2)
(eq-schema3)
'(e p q)
'(e q r))
'(i p r)
:must-use '(6 7))
(coder (list (ii-schema)
(id-schema)
(eq-schema1)
(eq-schema2)
(eq-schema3)
'(e p q)
'(e q r))
'(i r p)
:must-use '(6 7))
(coder (list (ii-schema)
(id-schema)
(eq-schema1)
(eq-schema2)
(eq-schema3)
'(i p r)
'(i r p))
'(e p r)
:must-use '(6 7)))
(defun coder-ex7b ()
;; 12-step proof
(coder (list (ii-schema)
(id-schema)
(eq-schema1)
(eq-schema2)
(eq-schema3)
'(e p q)
'(e q r))
'(together (e p r) (i p q) (i q r) (i p r) (i r q) (i q p) (i r p))
:must-use t
:max-syms 7))
(defun coder-ex8 (&rest options)
;; 3-step proof
(apply
'coder
(list (ii-schema)
(id-schema)
(cr-schema1)
(cr-schema2)
(eq-schema1)
(eq-schema2)
(eq-schema3)
(or-schema)
'q)
'(o p q)
options))
(defun coder-ex9 (&rest options)
;; no 1,...,8-step proof
;; 9-step proof by (coder-ex9 :max-syms 18 :max-vars 2)
(apply
'coder
(list (ii-schema)
(id-schema)
(cr-schema1)
(cr-schema2)
(eq-schema1)
(eq-schema2)
(eq-schema3)
(or-schema)
'p)
'(o p q)
options))
(defun coder-ex10 (&rest options)
;; no 1,...,8-step proof
;; 13-step proof by (coder-ex10 :max-syms 18 :max-vars 2 :must-use '(1 2 3 4 5 6 8 9 10 11))
(apply
'coder
(list (ii-schema)
(id-schema)
(cr-schema1)
(cr-schema2)
(eq-schema1)
(eq-schema2)
(eq-schema3)
(or-schema)
(and-schema)
'p
'q)
'(a p q)
options))
(defun coder-ex11 (&rest options)
;; no 1,...,8-step proof
;; 9-step proof by (coder-ex11 :max-syms 16 :max-vars 2)
(apply
'coder
(list (ii-schema)
(id-schema)
(cr-schema1)
(cr-schema2)
(eq-schema1)
(eq-schema2)
(eq-schema3)
(alt-and-schema)
'p
'q)
'(a p q)
options))
;;; coder-examples.lisp EOF

Binary file not shown.

View file

@ -0,0 +1,82 @@
;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: snark-user -*-
;;; File: front-last-example.lisp
;;; The contents of this file are subject to the Mozilla Public License
;;; Version 1.1 (the "License"); you may not use this file except in
;;; compliance with the License. You may obtain a copy of the License at
;;; http://www.mozilla.org/MPL/
;;;
;;; Software distributed under the License is distributed on an "AS IS"
;;; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
;;; License for the specific language governing rights and limitations
;;; under the License.
;;;
;;; The Original Code is SNARK.
;;; The Initial Developer of the Original Code is SRI International.
;;; Portions created by the Initial Developer are Copyright (C) 1981-2002.
;;; All Rights Reserved.
;;;
;;; Contributor(s): Mark E. Stickel <stickel@ai.sri.com>.
(in-package :snark-user)
;;; Let L be a nonempty list.
;;; Synthesize a program to compute the FRONT and LAST
;;; of the list where LAST of a list is its last element
;;; and FRONT is the list of all elements except the last.
;;;
;;; The program specification is
;;; (EXISTS (Y Z) (= L (APPEND Y (CONS Z NIL))))
;;; i.e., find Y and Z such that L can be formed by
;;; appending Y (the FRONT of L) and a single element list
;;; containing Z (the LAST of L).
;;;
;;; The appropriate inductive axiom is given explicitly in the axiom
;;; named induction.
;;;
;;; Necessary properties of APPEND, CONS, HEAD, and TAIL are given
;;; in the axioms named append-nil, append-cons, and cons-definition.
;;;
;;; A proof of the query is found and the program
;;; defined by the values found for variables Y and Z
;;; in the specification.
;;;
;;; Resolution and paramodulation (for equality) are the inference
;;; rules used.
(defun front-last-example ()
;; Waldinger program synthesis example 1989-12-14
(initialize)
(use-resolution)
(use-paramodulation)
(use-literal-ordering-with-resolution 'literal-ordering-p)
(use-literal-ordering-with-paramodulation 'literal-ordering-p)
(use-conditional-answer-creation)
(declare-constant 'nil)
(declare-constant 'l)
(declare-function 'head 1)
(declare-function 'tail 1)
(declare-function 'cons 2)
(declare-function 'append 2)
(declare-function 'front 1)
(declare-function 'last 1)
(declare-ordering-greaterp 'l 'nil)
(declare-ordering-greaterp 'head 'l)
(declare-ordering-greaterp 'tail 'l)
(declare-ordering-greaterp 'cons 'head)
(declare-ordering-greaterp 'cons 'tail)
(declare-ordering-greaterp 'append 'cons)
;;(assert '(forall (x) (= x x)))
(assert '(/= l nil)
:name 'l-nonempty)
(assert '(implies (and (/= l nil) (/= (tail l) nil))
(= (tail l) (append (front (tail l)) (cons (last (tail l)) nil))))
:name 'induction)
(assert '(forall (u) (= (append nil u) u))
:name 'append-nil)
(assert '(forall (u v w) (= (append (cons u v) w) (cons u (append v w))))
:name 'append-cons)
(assert '(forall (x) (implied-by (= x (cons (head x) (tail x))) (/= x nil)))
:name 'cons-definition)
(prove '(= l (append ?y (cons ?z nil))) :answer '(values ?y ?z)))
;;; front-last-example.lisp EOF

Binary file not shown.

View file

@ -0,0 +1,130 @@
;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: snark-user -*-
;;; File: hot-drink-example.lisp
;;; The contents of this file are subject to the Mozilla Public License
;;; Version 1.1 (the "License"); you may not use this file except in
;;; compliance with the License. You may obtain a copy of the License at
;;; http://www.mozilla.org/MPL/
;;;
;;; Software distributed under the License is distributed on an "AS IS"
;;; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
;;; License for the specific language governing rights and limitations
;;; under the License.
;;;
;;; The Original Code is SNARK.
;;; The Initial Developer of the Original Code is SRI International.
;;; Portions created by the Initial Developer are Copyright (C) 1981-2005.
;;; All Rights Reserved.
;;;
;;; Contributor(s): Mark E. Stickel <stickel@ai.sri.com>.
(in-package :snark-user)
;;; this is a simple example of one way of implementing partitions in SNARK
;;; rows are annotated with the partitions they're in and inferences are
;;; restricted to rows in the same partitions
;;;
;;; a partition communication table is used to augment the annotation
;;; of derived rows in case the row should be included in a neighboring
;;; partition too
;;;
;;; the partition communication table computation is invoked by including
;;; it as a pruning test
;;;
;;; this code is more illustrative than definitive
;;; partition communication table is a set of triples
;;; (from-partition to-partition relation-names) like
;;; (1 2 (water))
;;; (2 3 (steam))
(defun row-predicate-names (row)
(row-relation-names row))
(defun row-relation-names (row)
;; returns list of relation names in formula part
;; (but not answer, constraint, etc. parts) of a row
(let ((names nil))
(prog->
(snark::map-atoms-in-wff (row-wff row) ->* atom polarity)
(declare (ignore polarity))
(dereference
atom nil
:if-constant (pushnew (constant-name atom) names)
:if-compound (pushnew (function-name (head atom)) names)))
names))
(defun partition-communication (row)
;; could try to refine the context for added partitions
(when (use-partitions?)
(let ((table (partition-communication-table?))
(preds (row-relation-names row))
(context (snark::row-context row))
(more-context nil))
(flet ((message-passing-from (x)
(prog->
(car x -> part1)
(sparse-matrix-row table part1 ->nonnil row)
(cdr x -> ctxt1)
(map-sparse-vector-with-indexes row ->* preds2 part2)
(when (and (null (assoc part2 context))
(null (assoc part2 more-context))
(subsetp preds preds2))
(push (cons part2 ctxt1) more-context)
nil))))
(mapc #'message-passing-from context)
(do ()
((null more-context))
(push (pop more-context) context)
(message-passing-from (first context)))
(setf (snark::row-context row) context))))
nil)
(defun hot-drink-example (&key (use-partitions t) (use-ordering nil))
;; Amir & McIlraith partition-based reasoning example
(initialize)
(when use-partitions
(use-partitions '(1 2 3))
(partition-communication-table
(let ((pct (make-sparse-matrix)))
(setf (sparef pct 1 2) '(water)
(sparef pct 2 3) '(steam))
pct))
(pruning-tests (append (pruning-tests?) '(partition-communication))))
(cond
(use-ordering
(use-resolution t)
(use-literal-ordering-with-resolution 'literal-ordering-a)
(declare-proposition 'ok_pump)
(declare-proposition 'on_pump)
(declare-proposition 'man_fill)
(declare-proposition 'water)
(declare-proposition 'ok_boiler)
(declare-proposition 'on_boiler)
(declare-proposition 'steam)
(declare-proposition 'coffee)
(declare-proposition 'hot_drink)
(declare-ordering-greaterp '(ok_pump on_pump man_fill) 'water)
(declare-ordering-greaterp '(water ok_boiler on_boiler) 'steam)
(declare-ordering-greaterp 'coffee 'hot_drink))
(t
(use-hyperresolution t)))
(dolist (wff '((or (not ok_pump) (not on_pump) water)
(or (not man_fill) water)
(or (not man_fill) (not on_pump))
(or man_fill on_pump)))
(assert wff :partitions '(1)))
(dolist (wff '((or (not water) (not ok_boiler) (not on_boiler) steam)
(or water (not steam))
(or ok_boiler (not steam))
(or on_boiler (not steam))))
(assert wff :partitions '(2)))
(dolist (wff '((or (not steam) (not coffee) hot_drink)
(or coffee teabag)
(or (not steam) (not teabag) hot_drink)))
(assert wff :partitions '(3)))
(assume 'ok_pump :partitions '(1))
(assume 'ok_boiler :partitions '(2))
(assume 'on_boiler :partitions '(2))
(closure))
;;; hot-drink-example.lisp EOF

Binary file not shown.

View file

@ -0,0 +1,121 @@
;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: snark-user -*-
;;; File: latin-squares.lisp
;;; The contents of this file are subject to the Mozilla Public License
;;; Version 1.1 (the "License"); you may not use this file except in
;;; compliance with the License. You may obtain a copy of the License at
;;; http://www.mozilla.org/MPL/
;;;
;;; Software distributed under the License is distributed on an "AS IS"
;;; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
;;; License for the specific language governing rights and limitations
;;; under the License.
;;;
;;; The Original Code is SNARK.
;;; The Initial Developer of the Original Code is SRI International.
;;; Portions created by the Initial Developer are Copyright (C) 1981-2006.
;;; All Rights Reserved.
;;;
;;; Contributor(s): Mark E. Stickel <stickel@ai.sri.com>.
(in-package :snark-user)
(defun latin-square-clauses (order &key clause-set (standard t) &allow-other-keys)
(let ((n-1 (- order 1)))
;; row, column, and values are numbered in [0,...,order-1]
(unless clause-set
(setf clause-set (make-dp-clause-set)))
(dp-insert-wff `(forall ((i :in (ints 0 ,n-1)) (j :in (ints 0 ,n-1))) (exists ((k :in (ints 0 ,n-1))) (p i j k))) clause-set)
(dp-insert-wff `(forall ((i :in (ints 0 ,n-1)) (k :in (ints 0 ,n-1))) (exists ((j :in (ints 0 ,n-1))) (p i j k))) clause-set)
(dp-insert-wff `(forall ((j :in (ints 0 ,n-1)) (k :in (ints 0 ,n-1))) (exists ((i :in (ints 0 ,n-1))) (p i j k))) clause-set)
(dp-insert-wff `(forall ((i :in (ints 0 ,n-1))
(j :in (ints 0 ,n-1))
(k :in (ints 1 ,n-1))
(l :in (ints 0 (- k 1))))
(and
(or (not (p i j l)) (not (p i j k)))
(or (not (p i l j)) (not (p i k j)))
(or (not (p l i j)) (not (p k i j)))))
clause-set)
(when standard
;; fix first row and column for standard form
(dp-insert-wff `(forall ((j :in (ints 0 ,n-1))) (p 0 j j)) clause-set)
(dp-insert-wff `(forall ((i :in (ints 0 ,n-1))) (p i 0 i)) clause-set))
clause-set))
(defun model-to-latin-square (atoms &optional order)
;; convert list of p atoms to sequence of sequences representation of latin square
(unless order
(let ((n 0)) ;find its order
(dolist (atom atoms)
(when (and (consp atom) (eq 'p (first atom)))
(dolist (k (rest atom))
(when (> k n)
(setf n k)))))
(setf order (+ n 1))))
(let ((ls (make-array order)))
(dotimes (i order)
(setf (aref ls i) (make-array order :initial-element nil)))
(dolist (atom atoms)
(when (and (consp atom) (eq 'p (first atom)))
(let ((i (second atom))
(j (third atom))
(k (fourth atom)))
(cl:assert (null (aref (aref ls i) j)))
(setf (aref (aref ls i) j) k))))
ls))
(defun generate-latin-squares (order &rest options &key (apply nil) (time t) &allow-other-keys)
(let (clause-set)
(flet ((make-clause-set ()
(setf clause-set (apply #'latin-square-clauses order options)))
(generate ()
(dp-satisfiable-p clause-set
:find-all-models -1
:model-test-function (and apply (lambda (model) (funcall apply (model-to-latin-square model order)) t))
:trace-choices nil)))
(if time (time (make-clause-set)) (make-clause-set))
(if time (time (generate)) (generate)))))
(defun print-latin-square (ls)
(map nil (lambda (row) (format t "~%") (map nil (lambda (v) (format t "~3@A" v)) row)) ls)
ls)
(defun latin-square-conjugate (ls conjugate)
(let* ((order (length ls))
(ls* (make-array order)))
(dotimes (i order)
(setf (elt ls* i) (make-array order :initial-element nil)))
(dotimes (i order)
(dotimes (j order)
(let ((k (elt (elt ls i) j)))
(ecase conjugate
(132
(setf (elt (elt ls* i) k) j))
(213
(setf (elt (elt ls* j) i) k))
(231
(setf (elt (elt ls* j) k) i))
((312 column)
(setf (elt (elt ls* k) i) j))
((321 row)
(setf (elt (elt ls* k) j) i))
(123 ;makes copy of ls
(setf (elt (elt ls* i) j) k))))))
ls*))
(defun latin-square-standard-form (ls)
(let* ((order (length ls))
(ls* (make-array order)))
(dotimes (i order)
(setf (elt ls* i) (make-array order :initial-element nil)))
;; renumber entries so first row is 0,...,order-1
(let ((row0 (elt ls 0)))
(dotimes (i order)
(let ((rowi (elt ls i))
(rowi* (elt ls* i)))
(dotimes (j order)
(setf (elt rowi* j) (position (elt rowi j) row0))))))
;; sort rows so that first column is 0,...,order-1
(sort ls* #'< :key (lambda (x) (elt x 0)))))
;;; latin-squares.lisp EOF

Binary file not shown.

View file

@ -0,0 +1,359 @@
;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: snark-user -*-
;;; File: overbeek-test.lisp
;;; The contents of this file are subject to the Mozilla Public License
;;; Version 1.1 (the "License"); you may not use this file except in
;;; compliance with the License. You may obtain a copy of the License at
;;; http://www.mozilla.org/MPL/
;;;
;;; Software distributed under the License is distributed on an "AS IS"
;;; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
;;; License for the specific language governing rights and limitations
;;; under the License.
;;;
;;; The Original Code is SNARK.
;;; The Initial Developer of the Original Code is SRI International.
;;; Portions created by the Initial Developer are Copyright (C) 1981-2008.
;;; All Rights Reserved.
;;;
;;; Contributor(s): Mark E. Stickel <stickel@ai.sri.com>.
(in-package :snark-user)
(defun overbeek-test (&key (verbose t))
#+Symbolics (zl:print-herald)
(let ((p1 (default-print-rows-when-given?))
(p2 (default-print-rows-when-derived?))
(p3 (default-print-rows-prettily?))
(p4 (default-print-final-rows?))
(p5 (default-print-options-when-starting?))
(p6 (default-print-assertion-analysis-notes?))
(p7 (default-print-term-memory-when-finished?))
(p8 (default-print-agenda-when-finished?)))
(unwind-protect
(let ((total-seconds 0.0))
(dolist (x '(
;; (print-rows-when-given print-rows-when-derived print-wffs-when-done problem-name)
(t t nil overbeek1)
(t t nil overbeek1e)
(t t nil overbeek3e)
(t t nil overbeek6)
(t t nil overbeek2e)
(t :signal nil overbeek2)
(t t nil overbeek4e)
(t t nil overbeek3)
(t t nil overbeek7e)
(t :signal nil overbeek7)
(t :signal nil overbeek4)
(t :signal nil overbeek5e)
(t :signal nil overbeek6e)
(t :signal nil overbeek5)
(t :signal nil overbeek6-1)
(t :signal nil overbeek4-1)
;; (t t nil overbeek5-1)
;; (t t nil overbeek7-1)
;; (t t nil overbeek7e-1)
;;overbeek8e
;;overbeek9e
;;overbeek10e
))
(dotimes (i 3) (terpri))
(let ((#-symbolics *break-on-signals* #+symbolics conditions::*break-on-signals* nil)
(snark::critique-options t))
(default-print-rows-when-given (and verbose (first x)))
(default-print-rows-when-derived (and verbose (second x)))
(default-print-row-wffs-prettily nil)
(unless verbose
(default-print-final-rows nil)
(default-print-options-when-starting nil)
(default-print-assertion-analysis-notes nil)
(default-print-term-memory-when-finished nil)
(default-print-agenda-when-finished nil))
(funcall (print (fourth x))))
(incf total-seconds snark-lisp::*total-seconds*)
(when (third x)
(terpri)
(print-rows :ancestry t))
(prin1 (fourth x))
(terpri))
(format t "~%OVERBEEK-TEST Total = ~D seconds" (round total-seconds)))
(default-print-rows-when-given p1)
(default-print-rows-when-derived p2)
(default-print-row-wffs-prettily p3)
(default-print-final-rows p4)
(default-print-options-when-starting p5)
(default-print-assertion-analysis-notes p6)
(default-print-term-memory-when-finished p7)
(default-print-agenda-when-finished p8)
nil)))
(defun refute-snark-example-file (name options &key format)
(refute-file
(make-pathname :directory (append (pathname-directory cl-user::*snark-system-pathname*) (list "examples"))
:name name
:type (case format (:tptp "tptp") (otherwise "kif")))
:options options
:format format
:ignore-errors nil
:verbose t
:output-file nil
:package :snark-user))
(defun overbeek1 ()
(refute-snark-example-file
"GRP001-1+rm_eq_rstfp"
'(;;(agenda-ordering-function #'fifo)
;;(row-weight-limit 4) ;4 is minimum value for which proof can be found
(declare-constant 'e :alias 'identity)
(declare-constant 'a)
(declare-constant 'b)
(declare-constant 'c)
(declare-function 'f 2 :alias 'multiply :ordering-status :left-to-right)
(declare-function 'g 1 :alias 'inverse :kbo-weight 0)
(declare-relation 'p 3 :alias 'product)
(ordering-functions>constants t)
(declare-ordering-greaterp 'g 'f 'c 'b 'a 'e)
(use-hyperresolution t)
(use-term-ordering :kbo))))
(defun overbeek2 ()
(refute-snark-example-file
"GRP002-1+rm_eq_rstfp"
'(;;(ROW-WEIGHT-LIMIT 9)
(declare-constant 'e :alias 'identity)
(declare-constant 'a)
(declare-constant 'b)
(declare-constant 'c)
(declare-constant 'd)
(declare-constant 'h)
(declare-constant 'j)
(declare-constant 'k)
(declare-function 'f 2 :alias 'multiply)
(declare-function 'g 1 :alias 'inverse :kbo-weight '(1 2))
(declare-relation 'p 3 :alias 'product)
(ordering-functions>constants t)
(declare-ordering-greaterp 'g 'f 'k 'j 'h 'd 'c 'b 'a 'e)
(use-hyperresolution t)
(use-term-ordering :kbo))))
(defun overbeek3 ()
(refute-snark-example-file
"RNG008-6+rm_eq_rstfp"
'(;;(agenda-ordering-function #'fifo)
;;(row-weight-limit 8) ;8 is minimum value for which proof can be found
(declare-constant 'zero :alias 'additive_identity)
(declare-constant 'a)
(declare-constant 'b)
(declare-constant 'c)
(declare-function 'j 2 :alias 'add :ordering-status :left-to-right)
(declare-function 'f 2 :alias 'multiply :ordering-status :left-to-right)
(declare-function 'g 1 :alias 'additive_inverse :kbo-weight 0)
(declare-relation 's 3 :alias 'sum)
(declare-relation 'p 3 :alias 'product)
(ordering-functions>constants t)
(declare-ordering-greaterp 'g 'f 'j 'c 'b 'a 'zero)
(use-hyperresolution t)
(use-term-ordering :kbo))))
(defun overbeek4 ()
(refute-snark-example-file
"LCL024-1+rm_eq_rstfp"
'((declare-relation 'p 1 :alias 'is_a_theorem)
(declare-function 'e 2 :alias 'equivalent)
(use-hyperresolution t))))
(defun overbeek5 ()
(refute-snark-example-file
"LCL038-1+rm_eq_rstfp"
'((declare-relation 'p 1 :alias 'is_a_theorem)
(declare-function 'i 2 :alias 'implies)
(use-hyperresolution t))))
(defun overbeek6 ()
(refute-snark-example-file
"LCL111-1"
'((declare-relation 'p 1 :alias '|is_a_theorem|)
(declare-function 'i 2 :alias '|implies|)
(declare-function 'n 1 :alias '|not|)
;;(agenda-ordering-function #'fifo) ;very fast with fifo ordering
(use-hyperresolution t)
(level-pref-for-giving 1))
:format :tptp))
(defun overbeek7 ()
(refute-snark-example-file
"LCL114-1+rm_eq_rstfp"
'((declare-relation 'p 1 :alias 'is_a_theorem)
(declare-function 'i 2 :alias 'implies)
(declare-function 'n 1 :alias 'not)
(use-hyperresolution t)
(level-pref-for-giving 1))))
(defun overbeek4-1 ()
(refute-snark-example-file
"LCL024-1+rm_eq_rstfp"
'((declare-relation 'p 1 :alias 'is_a_theorem)
(declare-function 'e 2 :alias 'equivalent)
(use-resolution t)
(use-literal-ordering-with-resolution 'literal-ordering-a))))
(defun overbeek5-1 ()
(refute-snark-example-file
"LCL038-1+rm_eq_rstfp"
'((declare-relation 'p 1 :alias 'is_a_theorem)
(declare-function 'i 2 :alias 'implies)
(use-resolution t)
(use-literal-ordering-with-resolution 'literal-ordering-a))))
(defun overbeek6-1 ()
(refute-snark-example-file
"LCL111-1"
'((declare-relation 'p 1 :alias '|is_a_theorem|)
(declare-function 'i 2 :alias '|implies|)
(declare-function 'n 1 :alias '|not|)
(use-resolution t)
(assert-context :current)
(use-literal-ordering-with-resolution 'literal-ordering-a)
(level-pref-for-giving 1))
:format :tptp))
(defun overbeek7-1 ()
(refute-snark-example-file
"LCL114-1+rm_eq_rstfp"
'((declare-relation 'p 1 :alias 'is_a_theorem)
(declare-function 'i 2 :alias 'implies)
(declare-function 'n 1 :alias 'not)
(use-resolution t)
(use-literal-ordering-with-resolution 'literal-ordering-a)
(level-pref-for-giving 1))))
(defun overbeek1e ()
(refute-snark-example-file
"GRP002-3+rm_eq_rstfp"
'((declare-constant 'e :alias 'identity)
(declare-constant 'a)
(declare-constant 'b)
(declare-function 'f 2 :alias 'multiply :ordering-status :left-to-right)
(declare-function 'g 1 :alias 'inverse :kbo-weight '(1 2))
(declare-function 'h 2 :alias 'commutator :kbo-weight '(5 3 3) :ordering-status :left-to-right)
(ordering-functions>constants t)
(declare-ordering-greaterp 'h 'g 'f 'b 'a 'e)
(use-paramodulation t)
(use-term-ordering :kbo))))
(defun overbeek2e ()
(refute-snark-example-file
"ROB005-1+rm_eq_rstfp"
'((declare-constant 'a)
(declare-constant 'b)
(declare-constant 'c)
(declare-function 'o 2 :alias 'add)
(declare-function 'n 1 :alias 'negate)
(ordering-functions>constants t)
(declare-ordering-greaterp 'n 'o 'a 'b 'c)
(use-paramodulation t))))
(defun overbeek3e ()
(refute-snark-example-file
"BOO002-1+rm_eq_rstfp"
'(;;(agenda-ordering-function #'fifo)
;;(row-weight-limit 15) ;15 is minimum value for which proof can be found
(declare-function 'f 3 :alias 'multiply :ORDERING-STATUS :RIGHT-TO-LEFT)
(declare-function 'g 1 :alias 'inverse)
(declare-constant 'a)
(declare-constant 'b)
(declare-ordering-greaterp 'b 'a 'g 'f)
(use-paramodulation t)
(use-term-ordering :kbo))))
(defun overbeek4e ()
(refute-snark-example-file
"GRP014-1+rm_eq_rstfp"
'((declare-constant 'a)
(declare-constant 'b)
(declare-constant 'c)
(declare-function 'f 2 :alias 'multiply :ordering-status :left-to-right)
(declare-function 'i 1 :alias 'inverse :kbo-weight 0)
(ordering-functions>constants t)
(declare-ordering-greaterp 'i 'f 'c 'b 'a)
(use-paramodulation t)
(use-term-ordering :kbo) ;KBO better than RPO 4/20/92
;;(use-function-creation t) ;constant-creation only, insert new symbols into KB ordering
)))
(defun overbeek5e ()
(refute-snark-example-file
"LCL109-2+rm_eq_rstfp"
'(;;(ROW-WEIGHT-LIMIT 21) ;21 works, think 19 will too
(declare-function 'i 2 :alias 'implies #| :ordering-status :left-to-right |#)
(declare-function 'n 1 :alias 'not)
(declare-constant 'a)
(declare-constant 'b)
(declare-constant 't :alias 'true0)
(ordering-functions>constants t)
(declare-ordering-greaterp 'i 'n 'a 'b 't)
(use-paramodulation t))))
(defun overbeek6e ()
(refute-snark-example-file
"COL049-1+rm_eq_rstfp"
'(;;(row-weight-limit 21) ;don't know what value works (19 doesn't)
(declare-function 'a 2 :alias 'apply :ordering-status :left-to-right)
(declare-function 'f 1 :weight-code (list (constantly 1)))
(declare-constant 'b)
(declare-constant 'm)
(declare-constant 'w)
(ordering-functions>constants t)
(declare-ordering-greaterp 'a 'f 'b 'w 'm)
(use-paramodulation t))))
(defun overbeek7e ()
(refute-snark-example-file
"RNG009-5+rm_eq_rstfp"
'((row-weight-before-simplification-limit 100)
(row-weight-limit 50)
(declare-constant 'zero :alias 'additive_identity)
(declare-function '* 2 :alias 'multiply :ordering-status :left-to-right)
(declare-function '- 1 :alias 'additive_inverse)
(declare-function '+ 2 :alias 'add)
(ordering-functions>constants t)
(declare-ordering-greaterp '* '- '+ 'zero)
(DECLARE-CANCELLATION-LAW '= '+ 'zero)
(use-paramodulation t))))
(defun overbeek7e-1 ()
(refute-snark-example-file
"RNG009-5+rm_eq_rstfp"
'((row-weight-before-simplification-limit 100)
(row-weight-limit 50)
(declare-constant 'zero :alias 'additive_identity)
(declare-function '* 2 :alias 'multiply :ordering-status :left-to-right)
(declare-function '- 1 :alias 'additive_inverse)
(declare-function '+ 2 :alias 'add)
(ordering-functions>constants t)
(declare-ordering-greaterp '* '- '+ 'zero)
(DECLARE-CANCELLATION-LAW '= '+ 'zero)
(use-paramodulation t)
(use-associative-unification t))))
(defun overbeek8e ()
(refute-snark-example-file
"COL003-1+rm_eq_rstfp"
'((declare-function 'a 2 :alias 'apply :ordering-status :left-to-right)
(declare-function 'f 1 :weight-code (list (constantly 1)))
(declare-constant 'b)
(declare-constant 'w)
(ordering-functions>constants t)
(declare-ordering-greaterp 'a 'f 'b 'w)
(use-paramodulation t))))
(defun overbeek9e ()
(refute-snark-example-file
"RNG010-5+rm_eq_rstfp"
'((use-paramodulation t))))
(defun overbeek10e ()
(refute-snark-example-file
"RNG011-5+rm_eq_rstfp"
'((use-paramodulation t))))
;;; overbeek-test.lisp EOF

View file

@ -0,0 +1,191 @@
;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: snark-user -*-
;;; File: ramsey-examples.lisp
;;; The contents of this file are subject to the Mozilla Public License
;;; Version 1.1 (the "License"); you may not use this file except in
;;; compliance with the License. You may obtain a copy of the License at
;;; http://www.mozilla.org/MPL/
;;;
;;; Software distributed under the License is distributed on an "AS IS"
;;; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
;;; License for the specific language governing rights and limitations
;;; under the License.
;;;
;;; The Original Code is SNARK.
;;; The Initial Developer of the Original Code is SRI International.
;;; Portions created by the Initial Developer are Copyright (C) 1981-2006.
;;; All Rights Reserved.
;;;
;;; Contributor(s): Mark E. Stickel <stickel@ai.sri.com>.
(in-package :snark-user)
;;; see http://mathworld.wolfram.com/RamseyNumber.html
;;; for Ramsey Number definition and results
;;;
;;; r( 3, 3) = 6 done
;;; r( 3, 4) = 9 done
;;; r( 3, 5) = 14 done
;;; r( 3, 6) = 18
;;; r( 3, 7) = 23
;;; r( 3, 8) = 28
;;; r( 3, 9) = 36
;;; r( 3,10) in [40,43]
;;; r( 4, 4) = 18
;;; r( 4, 5) = 25
;;; r( 4, 6) in [35,41]
;;; r( 5, 5) in [43,49]
;;; r( 6, 6) in [102,165]
(defun ramsey-3-3 (n)
;; results: found to be satisfiable for n=5, unsatisfiable for n=6 (should be unsatisfiable iff n>=6)
(let ((clause-set (make-dp-clause-set)))
(no-clique-of-order-3 n clause-set)
(no-independent-set-of-order-3 n clause-set)
(dp-satisfiable-p clause-set :atom-choice-function #'choose-an-atom-of-a-shortest-clause)))
(defun ramsey-3-4 (n)
;; results: found to be satisfiable for n=8, unsatisfiable for n=9 (should be unsatisfiable iff n>=9)
(let ((clause-set (make-dp-clause-set)))
(no-clique-of-order-3 n clause-set)
(no-independent-set-of-order-4 n clause-set)
(dp-satisfiable-p clause-set :atom-choice-function #'choose-an-atom-of-a-shortest-clause)))
(defun ramsey-3-5 (n)
;; results: found to be satisfiable for n=13, unsatisfiable for n=14 (should be unsatisfiable iff n>=14)
(let ((clause-set (make-dp-clause-set)))
(no-clique-of-order-3 n clause-set)
(no-independent-set-of-order-5 n clause-set)
(dp-satisfiable-p clause-set :atom-choice-function #'choose-an-atom-of-a-shortest-clause)))
(defun ramsey-3-6 (n)
;; results: found to be satisfiable for n=17, unsatisfiable for n=?? (should be unsatisfiable iff n>=18)
(let ((clause-set (make-dp-clause-set)))
(no-clique-of-order-3 n clause-set)
(no-independent-set-of-order-6 n clause-set)
(dp-satisfiable-p clause-set :atom-choice-function #'choose-an-atom-of-a-shortest-clause)))
(defun ramsey-4-4 (n)
;; results: found to be satisfiable for n=17, unsatisfiable for n=?? (should be unsatisfiable iff n>=18)
(let ((clause-set (make-dp-clause-set)))
(no-clique-of-order-4 n clause-set)
(no-independent-set-of-order-4 n clause-set)
(dp-satisfiable-p clause-set :atom-choice-function #'choose-an-atom-of-a-shortest-clause)))
(defun ramsey-4-5 (n)
;; results: found to be satisfiable for n=23, unsatisfiable for n=?? (should be unsatisfiable iff n>=25)
(let ((clause-set (make-dp-clause-set)))
(no-clique-of-order-4 n clause-set)
(no-independent-set-of-order-5 n clause-set)
(dp-satisfiable-p clause-set :atom-choice-function #'choose-an-atom-of-a-shortest-clause-WITH-MOST-OCCURRENCES-RANDOMLY)))
(defun ramsey-4-6 (n)
;; results: found to be satisfiable for n=29, unsatisfiable for n=??
(let ((clause-set (make-dp-clause-set)))
(no-clique-of-order-4 n clause-set)
(no-independent-set-of-order-6 n clause-set)
(dp-satisfiable-p clause-set :atom-choice-function #'choose-an-atom-of-a-shortest-clause-WITH-MOST-OCCURRENCES-RANDOMLY)))
(defun no-clique-of-order-3 (nnodes clause-set)
;; in every 3 node subset, at least one pair is not connected
(dp-insert-wff `(forall ((i :in (ints 1 ,nnodes))
(j :in (ints i ,nnodes) :except i)
(k :in (ints j ,nnodes) :except j))
(or (not (c i j)) (not (c i k)) (not (c j k))))
clause-set))
(defun no-clique-of-order-4 (nnodes clause-set)
;; in every 4 node subset, at least one pair is not connected
(dp-insert-wff `(forall ((i :in (ints 1 ,nnodes))
(j :in (ints i ,nnodes) :except i)
(k :in (ints j ,nnodes) :except j)
(l :in (ints k ,nnodes) :except k))
(or (not (c i j)) (not (c i k)) (not (c i l)) (not (c j k)) (not (c j l)) (not (c k l))))
clause-set))
(defun no-clique-of-order-5 (nnodes clause-set)
;; in every 5 node subset, at least one pair is not connected
(dp-insert-wff `(forall ((i :in (ints 1 ,nnodes))
(j :in (ints i ,nnodes) :except i)
(k :in (ints j ,nnodes) :except j)
(l :in (ints k ,nnodes) :except k)
(m :in (ints l ,nnodes) :except l))
(or (not (c i j)) (not (c i k)) (not (c i l)) (not (c i m))
(not (c j k)) (not (c j l)) (not (c j m))
(not (c k l)) (not (c k m))
(not (c l m))))
clause-set))
(defun no-clique-of-order-6 (nnodes clause-set)
;; in every 6 node subset, at least one pair is not connected
(dp-insert-wff `(forall ((i :in (ints 1 ,nnodes))
(j :in (ints i ,nnodes) :except i)
(k :in (ints j ,nnodes) :except j)
(l :in (ints k ,nnodes) :except k)
(m :in (ints l ,nnodes) :except l)
(n :in (ints m ,nnodes) :except m))
(or (not (c i j)) (not (c i k)) (not (c i l)) (not (c i m)) (not (c i n))
(not (c j k)) (not (c j l)) (not (c j m)) (not (c j n))
(not (c k l)) (not (c k m)) (not (c k n))
(not (c l m)) (not (c l n))
(not (c m n))))
clause-set))
(defun no-independent-set-of-order-3 (nnodes clause-set)
;; in every 3 node subset, at least one pair is connected
(dp-insert-wff `(forall ((i :in (ints 1 ,nnodes))
(j :in (ints i ,nnodes) :except i)
(k :in (ints j ,nnodes) :except j))
(or (c i j) (c i k) (c j k)))
clause-set))
(defun no-independent-set-of-order-4 (nnodes clause-set)
;; in every 4 node subset, at least one pair is connected
(dp-insert-wff `(forall ((i :in (ints 1 ,nnodes))
(j :in (ints i ,nnodes) :except i)
(k :in (ints j ,nnodes) :except j)
(l :in (ints k ,nnodes) :except k))
(or (c i j) (c i k) (c i l) (c j k) (c j l) (c k l)))
clause-set))
(defun no-independent-set-of-order-5 (nnodes clause-set)
;; in every 5 node-subset, at least one pair is connected
(dp-insert-wff `(forall ((i :in (ints 1 ,nnodes))
(j :in (ints i ,nnodes) :except i)
(k :in (ints j ,nnodes) :except j)
(l :in (ints k ,nnodes) :except k)
(m :in (ints l ,nnodes) :except l))
(or (c i j) (c i k) (c i l) (c i m)
(c j k) (c j l) (c j m)
(c k l) (c k m)
(c l m)))
clause-set))
(defun no-independent-set-of-order-6 (nnodes clause-set)
;; in every 6 node-subset, at least one pair is connected
(dp-insert-wff `(forall ((i :in (ints 1 ,nnodes))
(j :in (ints i ,nnodes) :except i)
(k :in (ints j ,nnodes) :except j)
(l :in (ints k ,nnodes) :except k)
(m :in (ints l ,nnodes) :except l)
(n :in (ints m ,nnodes) :except m))
(or (c i j) (c i k) (c i l) (c i m) (c i n)
(c j k) (c j l) (c j m) (c j n)
(c k l) (c k m) (c k n)
(c l m) (c l n)
(c m n)))
clause-set))
(defun ramsey-test ()
;; there doesn't seem to be any difference in search space size between choose-an-atom-of-a-shortest-clause and choose-an-atom-of-a-shortest-clause-randomly
;; choose-an-atom-of-a-shortest-clause-with-most-occurrences-randomly seems to work much better for satisfiable instances
(cl:assert (eval (print '(ramsey-3-3 5)))) ;2 branches
(cl:assert (not (eval (print '(ramsey-3-3 6))))) ;22 branches
(cl:assert (eval (print '(ramsey-3-4 8)))) ;4 branches
(cl:assert (not (eval (print '(ramsey-3-4 9))))) ;10,251 branches
(cl:assert (eval (print '(ramsey-3-5 13)))) ;93,125 branches
;;(cl:assert (not (eval (print '(ramsey-3-5 14))))) ;1,078,238,816 branches
;;(cl:assert (eval (print '(ramsey-4-4 17)))) ;56,181,666 branches
;;(cl:assert (not (eval (print '(ramsey-4-4 18)))))
)
;;; ramsey-examples.lisp EOF

Binary file not shown.

View file

@ -0,0 +1,51 @@
;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: snark-user -*-
;;; File: reverse-example.lisp
;;; The contents of this file are subject to the Mozilla Public License
;;; Version 1.1 (the "License"); you may not use this file except in
;;; compliance with the License. You may obtain a copy of the License at
;;; http://www.mozilla.org/MPL/
;;;
;;; Software distributed under the License is distributed on an "AS IS"
;;; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
;;; License for the specific language governing rights and limitations
;;; under the License.
;;;
;;; The Original Code is SNARK.
;;; The Initial Developer of the Original Code is SRI International.
;;; Portions created by the Initial Developer are Copyright (C) 1981-2006.
;;; All Rights Reserved.
;;;
;;; Contributor(s): Mark E. Stickel <stickel@ai.sri.com>.
(in-package :snark-user)
(defun reverse-example (&key (length 3) magic)
(let ((l nil))
(dotimes (i length)
(push i l))
(initialize)
(declare-function '$$cons 2 :new-name 'cons)
(declare-function '$$list :any :new-name 'list)
(declare-function '$$list* :any :new-name 'list*)
(cond
(magic
(use-hyperresolution t)
(use-magic-transformation t))
(t
(use-resolution t)
(assert-supported nil)
(assert-sequential t)
(print-rows-shortened t)))
(assert '(reverse nil nil))
(assert '(implied-by
(reverse (cons ?x ?l) ?l1)
(and
(reverse ?l ?l2)
(append ?l2 (cons ?x nil) ?l1))))
(assert '(append nil ?l ?l))
(assert '(implied-by
(append (cons ?x ?l1) ?l2 (cons ?x ?l3))
(append ?l1 ?l2 ?l3)))
(prove `(reverse (list ,@l) ?l) :answer '(values ?l))))
;;; reverse-example.lisp EOF

View file

@ -0,0 +1,19 @@
;;; a script to run some SNARK examples
;;; usage:
;;; cd snark
;;; lisp < examples/snark-test >& examples/snark-test.out &
#-snark (load "snark-system.lisp")
#-snark (make-snark-system)
(in-package :snark-user)
(default-print-row-wffs-prettily nil)
(overbeek-test)
(time (steamroller-example))
(time (front-last-example))
(time (reverse-example))
(time (reverse-example :magic t))
(time (hot-drink-example))
(coder-test)
(time (snark-dpll::queens-problem 8 :find-all-models -1))
(generate-latin-squares 7)
(quit)

Binary file not shown.

View file

@ -0,0 +1,82 @@
;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: snark-user -*-
;;; File: steamroller-example.lisp
;;; The contents of this file are subject to the Mozilla Public License
;;; Version 1.1 (the "License"); you may not use this file except in
;;; compliance with the License. You may obtain a copy of the License at
;;; http://www.mozilla.org/MPL/
;;;
;;; Software distributed under the License is distributed on an "AS IS"
;;; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
;;; License for the specific language governing rights and limitations
;;; under the License.
;;;
;;; The Original Code is SNARK.
;;; The Initial Developer of the Original Code is SRI International.
;;; Portions created by the Initial Developer are Copyright (C) 1981-2011.
;;; All Rights Reserved.
;;;
;;; Contributor(s): Mark E. Stickel <stickel@ai.sri.com>.
(in-package :snark-user)
(defun steamroller-example0 ()
(refute-snark-example-file
"PUZ031+1"
'((use-hyperresolution))))
(defun steamroller-example ()
(initialize)
(use-hyperresolution)
(declare-sort 'animal :subsorts-incompatible t)
(declare-sort 'plant :subsorts-incompatible t)
(declare-subsort 'bird 'animal)
(declare-subsort 'caterpillar 'animal)
(declare-subsort 'fox 'animal)
(declare-subsort 'snail 'animal)
(declare-subsort 'wolf 'animal)
(declare-subsort 'grain 'plant)
(declare-relation 'e 2 :sort '((1 animal))) ;animal*true
(declare-relation 'm 2 :sort '((t animal))) ;animal*animal
(declare-variable '?a1 :sort 'animal)
(declare-variable '?a2 :sort 'animal)
(assertion (forall ((?s1 snail) (?b1 bird)) ;KIF-style sort specification
(m ?s1 ?b1)) ;all KIF variables begin with ?
:name snails-are-smaller-than-birds)
(assertion (forall ((b1 :sort bird) (f1 :sort fox)) ;SNARK-preferred sort specification
(m b1 f1))
:name birds-are-smaller-than-foxes)
(assertion (forall ((f1 true :sort fox)
(w1 wolf :sort wolf)) ;this works too
(m f1 w1))
:name foxes-are-smaller-than-wolves)
(assertion (forall ((w1 wolf) (f1 fox))
(not (e w1 f1)))
:name wolves-dont-eat-foxes)
(assertion (forall ((w1 :sort wolf) (g1 :sort grain))
(not (e w1 g1)))
:name wolves-dont-eat-grain)
(assertion (forall ((b1 :sort bird) (c1 :sort caterpillar))
(e b1 c1))
:name birds-eat-caterpillars)
(assertion (forall ((b1 :sort bird) (s1 :sort snail))
(not (e b1 s1)))
:name birds-dont-eat-snails)
(assertion (forall ((c1 :sort caterpillar))
(exists ((p1 :sort plant))
(e c1 p1)))
:name caterpillars-eat-some-plants)
(assertion (forall ((s1 :sort snail))
(exists ((p1 :sort plant))
(e s1 p1)))
:name snails-eat-some-plants)
(assertion (forall ((p1 :sort plant) (p2 :sort plant))
(implied-by (or (e ?a1 ?a2) (e ?a1 p1)) (and (m ?a2 ?a1) (e ?a2 p2)))))
(prove '(and (e ?x.animal ?y.animal) (e ?y.animal ?z.grain))
:answer '(values ?x.animal ?y.animal ?z.grain)))
;;; steamroller-example.lisp EOF