Crate prop

Source
Expand description

§Prop

Propositional logic with types in Rust.

A library in Rust for theorem proving with Intuitionistic Propositional Logic. Supports theorem proving in Classical Propositional Logic.

Abbreviations:

  • IPL: Intuitionistic/Constructive Propositional Logic
  • EL: Existential Logic (Excluded Middle of Non-Existence)
  • PL: Classical Propositional Logic
  • PSI: Path Semantical Intuitionistic/Constructive Propositional Logic
  • PSEL: Path Semantical Existential Logic
  • PSL: Path Semantical Classical Propositional Logic
  • PSQ: Path Semantical Quantum Propositional Logic
  • HOOO EP: Higher Order Operator Overloading Exponential Propositions
  • MEL: Middle Exponential Logic

§Motivation

Path Semantics extends dependent types with normal paths and is also used to extend Classical Propositional Logic with multiple levels of propositions. It is also used to explore higher dimensional mathematics. A popular research subject in Path Semantics is Avatar Extensions.

When researching, in some cases it is useful to figure out whether a proof is provable in classical logic, but not in constructive logic. This requires comparing proofs easily.

This library uses a lifting mechanism for making it easier to produce proofs in classical logic and compare them to proofs in constructive logic.

§Design

This library contains:

  • Prop: Propositions that might or might not be decidable (constructive logic)
  • EProp: Existential propositions (existential logic)
  • DProp: Decidable propositions (classical logic)
  • LProp: Like Prop, but with path semantics (path semantical constructive logic)
  • ELProp: Like EProp, but with path semantics (path semantical existential logic)
  • DLProp: Like DProp, but with path semantics (path semantical classical logic)
  • Automatic lifting of Excluded Middle of Non-Existence to existential propositions
  • Automatic lifting of Excluded Middle to decidable propositions
  • Double Negation for proofs of Prop
  • A model of Path Semantical Quality/Aquality in IPL (see “quality” module)
  • A model of Path Semantical Qubit in IPL (see “qubit” module)
  • A model of Path Semantical Con-Quality in IPL (see “con_qubit” module)
  • A model of Seshatic Queenity (see “queenity” module)
  • Formalization of the core axiom of Path Semantics
  • Exponential Propositions (HOOO) for tautological/paradoxical theorem proving
  • A model of S5 Modal Logic derived from HOOO EP
  • A model of Avatar Modal Logic derived from HOOO EP and Theory of Avatar Extensions
  • A model of Middle Exponential Logic using EL and HOOO EP
  • Tactics organized in modules by constructs (e.g. and or imply)

§Examples

use prop::*;

fn proof<A: Prop, B: Prop>(f: Imply<A, B>, a: A) -> B {
    imply::modus_ponens(f, a)
}

Notice that there is no DProp used here, which means that it is a constructive proof.

use prop::*;

fn proof<A: DProp, B: DProp>(f: Imply<Not<A>, Not<B>>) -> Imply<B, A> {
   imply::rev_modus_tollens(f)
}

Here, DProp is needed because rev_modus_tollens needs Excluded Middle. This limits the proof to decidable propositions.

§Path Semantics

Path Semantics is an extremely expressive language for mathematical programming. It uses a single core axiom, which models semantics of symbols.

Basically, mathematical languages contain a hidden symmetry due to use of symbols. Counter-intuitively, symbols are not “inherently” in logic.

One way to put it, is that the symbols “themselves” encode laws of mathematics. The hidden symmetry can be exploited to prove semantics and sometimes improve performance of automated theorem provers.

For more information, see the Path Semantics Project.

Modules§

and
Tactics for Logical AND.
ava_modal
Avatar Modal Logic
con_qubit
Path Semantical Con-Qubit
eq
Tactics for Logical EQ.
existence
Existential Logic
fun
Functional programming as propositions
fun_traits
Traits shows what would happen with alternative axioms for functional programming.
halt
Improved Halting Problem
hooo
Exponential Propositions
hooo_traits
Traits showing what would happen with alternative axioms for HOOO Exponential Propositions.
hott
Homotopy Type Theory
imply
Tactics for Logical IMPLY.
mid
Middle Exponential Logic
modal
Modal Logic
nat
Natural numbers with types.
not
Tactics for Logical NOT.
or
Tactics for Logical OR.
path_semantics
Path Semantics
quality
Path Semantical Quality
quality_traits
Traits showing what would happen with alternative axioms for Path Semantical Quality.
qubit
Path Semantical Qubit
queenity
Seshatic Queenity
sd
Symbolic Distinction
univalence
Quality Univalence

Macros§

eqx
Helps converting equality.
tauto
Maps expression to tautology.

Structs§

True
Logical true.

Enums§

Either
Sum type of left and right case.
False
Logical false.

Traits§

DProp
Shorthand for decidable proposition.
Decidable
Implemented by decidable types.
Prop
A proposition that might be decidable or undecidable.

Type Aliases§

And
Logical AND.
Dneg
Double negation.
Eq
Logical EQ.
ExcM
Excluded middle.
Iff
Alternative to Logical EQ.
Imply
Logical IMPLY.
Not
Logical NOT.
Or
Logical OR.