Introduction to Axi
Learn about Introduction to Axi in Axi programming language.
Welcome to Axi
Axi is a powerful deductive programming language for proof engineering and formal software development.
Key Features
- Familiar syntax and language features reduces the barrier of entry for developers who lack formal methods experience.
- Deductive programs generate proofs-as-traces, which are machine-checkable certificates of an Axi program's output
- Write custom tactics (encapsulated, reusable proof procedures) as easily as normal functions
- Programming and deduction can be mixed together seamlessly without sacrificing the soundness of formal proofs
- Powerful pattern matching
- Support for inductive data structures and inductive proofs.
- Support for equational reasoning and rewrite logic
Propositional Logic
Axi supports reasoning in the natural deduction style. We will declare some opaque propositions to reason about. Later we'll see that they are actually constant terms of a special type Boolean when we talk about first-order logic.
Constants
There is a global assumption base that contains all the axioms and all the theorems that have been proved so far.
The following assume
block proves .
It does this by inserting p
into the assumption base and then proving q
within that context. After the block is finished, p
and anything proved in the block will be removed from the assumption base. A final conclusion should be proved by the block. Let's say it's q
, then is proved by the whole assume block and added to the assumption base.
P implies Q
Basic Proof Rules
Expressions preceded with the bang operator (!) indicate that the expression is an invocation of a tactic. Tactics in proof development are analogous to functions in programming: they encapsulate reusable sequences of steps behind an easily callable interface. While functions encapsulate a series of computations, tactics encapsulate a series of deductive steps. Tactics terminate successfully only if the tactic's deductive steps are all valid relative to the assumption base that is present during the tactic's evaluation. Every tactic (indeed every deduction in Axi) produces a conclusion, and the conclusion is added to the outer scope's assumption base.
Below is a deduction that proves that using the tactic dn
(double-negation).
Double Negation
Axi comes with built in tactics for each of the deductive rules in propositional logic, including the introduction and elimination rules for each of the logical connectives.
Below, the introduction and elimination rules are demonstrated for conjunction, disjunction, implication and equivalence, as well as deductive rules such as modus ponens.