Skip to content

Commit

Permalink
refreshing
Browse files Browse the repository at this point in the history
  • Loading branch information
josd committed Jan 4, 2025
1 parent 9d415ea commit ac0d58a
Show file tree
Hide file tree
Showing 30 changed files with 64,158 additions and 451,838 deletions.
14 changes: 14 additions & 0 deletions plato/collatz-1.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
% Collatz conjecture
% See https://en.wikipedia.org/wiki/Collatz_conjecture

'<urn:example:collatz>'(N, N) :-
!.
'<urn:example:collatz>'(N0, N) :-
( N0 mod 2 =:= 0
-> N1 is N0//2
; N1 is 3*N0+1
),
'<urn:example:collatz>'(N1, N).

% query
(true :+ '<urn:example:collatz>'(N0, 1)) :- between(1, 1, N0).
14 changes: 14 additions & 0 deletions plato/collatz-1024.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
% Collatz conjecture
% See https://en.wikipedia.org/wiki/Collatz_conjecture

'<urn:example:collatz>'(N, N) :-
!.
'<urn:example:collatz>'(N0, N) :-
( N0 mod 2 =:= 0
-> N1 is N0//2
; N1 is 3*N0+1
),
'<urn:example:collatz>'(N1, N).

% query
(true :+ '<urn:example:collatz>'(N0, 1)) :- between(1, 1024, N0).
14 changes: 14 additions & 0 deletions plato/collatz-128.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
% Collatz conjecture
% See https://en.wikipedia.org/wiki/Collatz_conjecture

'<urn:example:collatz>'(N, N) :-
!.
'<urn:example:collatz>'(N0, N) :-
( N0 mod 2 =:= 0
-> N1 is N0//2
; N1 is 3*N0+1
),
'<urn:example:collatz>'(N1, N).

% query
(true :+ '<urn:example:collatz>'(N0, 1)) :- between(1, 128, N0).
14 changes: 14 additions & 0 deletions plato/collatz-16.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
% Collatz conjecture
% See https://en.wikipedia.org/wiki/Collatz_conjecture

'<urn:example:collatz>'(N, N) :-
!.
'<urn:example:collatz>'(N0, N) :-
( N0 mod 2 =:= 0
-> N1 is N0//2
; N1 is 3*N0+1
),
'<urn:example:collatz>'(N1, N).

% query
(true :+ '<urn:example:collatz>'(N0, 1)) :- between(1, 16, N0).
14 changes: 14 additions & 0 deletions plato/collatz-2.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
% Collatz conjecture
% See https://en.wikipedia.org/wiki/Collatz_conjecture

'<urn:example:collatz>'(N, N) :-
!.
'<urn:example:collatz>'(N0, N) :-
( N0 mod 2 =:= 0
-> N1 is N0//2
; N1 is 3*N0+1
),
'<urn:example:collatz>'(N1, N).

% query
(true :+ '<urn:example:collatz>'(N0, 1)) :- between(1, 2, N0).
14 changes: 14 additions & 0 deletions plato/collatz-2048.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
% Collatz conjecture
% See https://en.wikipedia.org/wiki/Collatz_conjecture

'<urn:example:collatz>'(N, N) :-
!.
'<urn:example:collatz>'(N0, N) :-
( N0 mod 2 =:= 0
-> N1 is N0//2
; N1 is 3*N0+1
),
'<urn:example:collatz>'(N1, N).

% query
(true :+ '<urn:example:collatz>'(N0, 1)) :- between(1, 2048, N0).
14 changes: 14 additions & 0 deletions plato/collatz-256.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
% Collatz conjecture
% See https://en.wikipedia.org/wiki/Collatz_conjecture

'<urn:example:collatz>'(N, N) :-
!.
'<urn:example:collatz>'(N0, N) :-
( N0 mod 2 =:= 0
-> N1 is N0//2
; N1 is 3*N0+1
),
'<urn:example:collatz>'(N1, N).

% query
(true :+ '<urn:example:collatz>'(N0, 1)) :- between(1, 256, N0).
14 changes: 14 additions & 0 deletions plato/collatz-32.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
% Collatz conjecture
% See https://en.wikipedia.org/wiki/Collatz_conjecture

'<urn:example:collatz>'(N, N) :-
!.
'<urn:example:collatz>'(N0, N) :-
( N0 mod 2 =:= 0
-> N1 is N0//2
; N1 is 3*N0+1
),
'<urn:example:collatz>'(N1, N).

% query
(true :+ '<urn:example:collatz>'(N0, 1)) :- between(1, 32, N0).
14 changes: 14 additions & 0 deletions plato/collatz-4.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
% Collatz conjecture
% See https://en.wikipedia.org/wiki/Collatz_conjecture

'<urn:example:collatz>'(N, N) :-
!.
'<urn:example:collatz>'(N0, N) :-
( N0 mod 2 =:= 0
-> N1 is N0//2
; N1 is 3*N0+1
),
'<urn:example:collatz>'(N1, N).

% query
(true :+ '<urn:example:collatz>'(N0, 1)) :- between(1, 4, N0).
14 changes: 14 additions & 0 deletions plato/collatz-4096.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
% Collatz conjecture
% See https://en.wikipedia.org/wiki/Collatz_conjecture

'<urn:example:collatz>'(N, N) :-
!.
'<urn:example:collatz>'(N0, N) :-
( N0 mod 2 =:= 0
-> N1 is N0//2
; N1 is 3*N0+1
),
'<urn:example:collatz>'(N1, N).

% query
(true :+ '<urn:example:collatz>'(N0, 1)) :- between(1, 4096, N0).
14 changes: 14 additions & 0 deletions plato/collatz-512.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
% Collatz conjecture
% See https://en.wikipedia.org/wiki/Collatz_conjecture

'<urn:example:collatz>'(N, N) :-
!.
'<urn:example:collatz>'(N0, N) :-
( N0 mod 2 =:= 0
-> N1 is N0//2
; N1 is 3*N0+1
),
'<urn:example:collatz>'(N1, N).

% query
(true :+ '<urn:example:collatz>'(N0, 1)) :- between(1, 512, N0).
14 changes: 14 additions & 0 deletions plato/collatz-64.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
% Collatz conjecture
% See https://en.wikipedia.org/wiki/Collatz_conjecture

'<urn:example:collatz>'(N, N) :-
!.
'<urn:example:collatz>'(N0, N) :-
( N0 mod 2 =:= 0
-> N1 is N0//2
; N1 is 3*N0+1
),
'<urn:example:collatz>'(N1, N).

% query
(true :+ '<urn:example:collatz>'(N0, 1)) :- between(1, 64, N0).
14 changes: 14 additions & 0 deletions plato/collatz-8.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
% Collatz conjecture
% See https://en.wikipedia.org/wiki/Collatz_conjecture

'<urn:example:collatz>'(N, N) :-
!.
'<urn:example:collatz>'(N0, N) :-
( N0 mod 2 =:= 0
-> N1 is N0//2
; N1 is 3*N0+1
),
'<urn:example:collatz>'(N1, N).

% query
(true :+ '<urn:example:collatz>'(N0, 1)) :- between(1, 8, N0).
14 changes: 14 additions & 0 deletions plato/collatz-8192.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
% Collatz conjecture
% See https://en.wikipedia.org/wiki/Collatz_conjecture

'<urn:example:collatz>'(N, N) :-
!.
'<urn:example:collatz>'(N0, N) :-
( N0 mod 2 =:= 0
-> N1 is N0//2
; N1 is 3*N0+1
),
'<urn:example:collatz>'(N1, N).

% query
(true :+ '<urn:example:collatz>'(N0, 1)) :- between(1, 8192, N0).
14 changes: 0 additions & 14 deletions plato/collatz.pl

This file was deleted.

7 changes: 7 additions & 0 deletions plato/output/collatz-1.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:- op(1200, xfx, :+).

% answers
answer('<urn:example:collatz>'(1, 1)).

% proof steps
step((true:+'<urn:example:collatz>'(1, 1)), '<urn:example:collatz>'(1, 1), true).
Loading

0 comments on commit ac0d58a

Please sign in to comment.