Propositio

From Esolang
Jump to navigation Jump to search

Propositio is an esolang based on logic theory.

Commands

A -> B    A implies B, if A then B
!A        Returns the opposite of A, can replace A in other commands
A         Sets A to true. !A sets A to false
A.        Outputs A.
A?        Only does the next instruction if A is true.
:A        Sets A's value to the user's input.
1.        Sets jump point 1. Can be any number of digits as long as it's only numbers.
> 1       Goes to jump point 1.
#         Ends program.
A !> B    Breaks all implications between A and B (including ones with !A or !B, or reversed ones from B -> A). Otherwise, any time A is true B will be reset to true.

Programs

Truth Machine

:A
1.
A.
A?
> 1
#

Cycler

This program takes A and B, then swaps their values.

:A
:B
A -> C
!A -> !C
A !> C
!A
B -> A
!B -> !A
B !> A
!B
C -> B
!C -> !B
C !> B
!C
A.
B.