CITP is a tool for proving properties of software systems specified using a form of order-sorted algebra with transition rules. In other words, the models are oriented graphs or transition systems endowed with an order-sorted algebraic structure. Moreover, some of the operations used, namely those that are regarded as constructors – and which are used to ‘build’ states – need to be monotonic, meaning that they preserve the transitions.
CITP uses Maude 3 as a rewriting engine. Hence, the first step is to download and install the Maude system following the instructions available here.
Once Maude has been installed, you can download the latest (May 2023) distribution of CITP from here.
You can copy the CITP files to a destination of your choosing, and then explicitly load them into Maude whenever you decide to run the tool. This could be done, for example, from a terminal:
tar -xzf citp-*.*.tar.gz
cp -R citp-*.*/src/ /home/user/citpIn this case, you need to set the MAUDE_LIB environment variable
appropriately, making sure it includes paths to libraries that are
bundled with Maude and to the CITP installation directory. For
example, assuming that Maude in installed under /usr/local/maude,
you could execute in a terminal:
export MAUDE_LIB=/usr/local/maude:/home/user/citpTo make this setting persistent, you could add the above line to your
.bashrc file.
On GNU/Linux machines, you can install CITP is by running the
following scripts from the directory where the latest CITP
distribution has been downloaded (as a tar.gz archive):
tar -xzf citp-*.*.tar.gz
cd citp-*.*
./configure
make
sudo make installIf you decided to load CITP explicitly into Maude, then you could launch the tool by typing:
maude -no-banner -allow-files [files] run-citpIf you opted for a system-wide installation, then CITP can be launched from the command line by typing:
citp [files]where [files] is a list of Maude files that you would like to have
loaded into Maude (in order to prove properties of them) before CITP.
Once CITP has started, you can load external proof files using the
command load file, exit the tool using the command quit, or input
goals and proofs directly from the command line.
To give an example, suppose we would like to prove that the multiplication of natural numbers distributes over addition. The first step is define the goal that we would like to prove. In our case, we prove the distributivity property based on two premises, which correspond to a standard axiomatization of the multiplication of natural numbers.
goal DIST is
fm forall {Y:Nat} 0 * Y:Nat = 0 .
fm forall {X:Nat, Y:Nat} (s X:Nat) * Y:Nat = X:Nat * Y:Nat + Y:Nat .
|-{NAT}
fm forall {X:Nat, Y:Nat, Z:Nat} X:Nat * (Y:Nat + Z:Nat) = X:Nat * Y:Nat + X:Nat * Z:Nat .
endg
The proof is done in three steps, each captured by a CITP tactic.
First, we apply induction on the variable X, which generates two new
(simpler) goals; then, we push all executable premises (including the
induction hypothesis) so that they could be used for term reductions
in the rest of the proof; and finally, we apply the tactic red,
which discharges all remaining goals.
begin proof P of DIST
ind(X:Nat)
push-all
red
qed
Several more complex examples are available here.
CITP supports the following system-level commands:
load Freads the contents of a file namedF; both relative and absolute paths are accepted.eofcauses the tool to stop reading from the current file.quitorqterminates the execution of the tool.list goalslists the names of all goals loaded into the CITP database.show goal Gdisplays the definition of a goal namedG.list proofslists the names of all proofs loaded into the CITP database.show proof Pdisplays tactics used within the proofP.begin proof P of Gstarts a new proof, namedPof the goalG.
Within proofs, i.e., after executing a begin proof command, CITP supports a different set of commands:
show proofdisplays the tactics used so far in the proof.show goals [abridged]displays summaries of all open goals.show goal [abridged]displays a summary of the curent open goal.show additionsdisplays all additional declarations generated during a proof.rollbackreverses the effect of the last list of tactics applied.reduce term Tevaluates a termTw.r.t. the curent module.search path from S to Tsearches for a rewrite path from a source termSto a target termTw.r.t. the current module.qedends the current proof and returns to the system level.
CITP supports the following tactics:
ind(V)for structural induction on the variableV.redorreducefor discharging the goals by applying the equations in the current specification.splitfor transforming a goal with multiple conclusions into several goals with a single conclusion.simpfor simplyfiny the goals.push(N)orpush(ID)for introducing premises into the current specification, whereNstands for the index of the premise andIDfor its identifier (given by metadata). Alternatively, it is possible to usepush-allto introduce all premises.pull(ID)for transforming a sentence in the specification into a premise.impfor the implication tactic.conjfor the conjunction tactic.disj(N)ordisj(ID)for the disjunction tactic, whereNstands for the index of the premise andIDfor its identifier (given by metadata).tcfor the theorem of constants.skfor Skolemization.cafor case analysis.ca-revfor case analysis reversing the order of the terms.csfor case analysis for sequences.init(ID, SB)orinit(N, SB), whereSBstands for a substitution,Nfor the index of the premise, andIDfor its identifier (given by metadata). When the substitution can be inferred from the context theinit(ID)tactic can be used for a particular identifier andinit-allfor all premises.subst(SB)for applying the substitutionSBin existential quantifications.transfor transitivity.@crt(T)is used for appyling the tacticTonly to the current goal.select(N), withNthe index of a goal, for selection theNth goal.
The CITP source code is licensed under the GNU General Public License v2.0 or later.