Iris Tactics
basics
(referenced from logsem iris tutorial)
Iris propositions include many of the usual logical connectives such
as conjunction P ∧ Q. As such, Iris uses a notation scope to
overload the usual logical notation in Coq. This scope is delimited by
I and bound to iProp Σ. Hence, you may need to wrap your
propositions in (_)%I to use the notations.
Iris uses ssreflect internally. This means the following changes are made to gallina tactics:
- No commas between arguments, meaning you have to write
rewrite H1 H2instead ofrewrite H1, H2. rewrite -Hinstead ofrewrite <-H. But the original also seems to work.- Occurrences are written in front of the argument (
rewrite {1 2 3}Hinstead ofrewrite H at 1 2 3) - Rewrite can unfold definitions as
rewrite /defwhich does thesame asunfold def
tactics
https://gitlab.mpi-sws.org/iris/iris/-/blob/master/docs/proof_mode.md
iIntros.: Same asintros. From my experience, it was simplier to intros specifically as much as possible. Start by iIntros-ing in bulk, and dissect as much as possible.iIntros "H".:intros HiIntros "[H1 H2]": Used to introsP * Qseparately into spatial context.iIntros "H1 & H2 & H3".: Used to intros multiple hypothesis at once.(H1 & .. & H2 & H3) = [H1 .. [H2 H3] ..].iIntros "[HP HQ]".: Used to introsP ∨ Q.iIntros "%x".: Used to intros∀ x.iIntros "(%x & Hx)".: Used to intros∃ x, Φ x.iIntros "(%x & (%y & Hxy))".: Used to intros∃ x y, Φ x y.iIntros "%H".: Intros⌜...⌝directly into coq context.iIntros "#H".: Intros a persistent hypothesis into the persistent context asHiIntros "... !>": CalliModIntrobefore introsing, removing later modalitiesiIntros ">H": CalliModinHbefore introsing, removing modalities fromH
iFrame.: Discharge immediate goals from a separating conjunction.iFrame "#": Use persistent hypotheses
iApply "H".: Same asapply.iApply ("H" with "[H1] [H2]").: If applyingHyields two subgoals, automatically passH1to the first andH2to the second.iApply ("H" $! x y z).: Same asapply (H x y z).x, y, zis from the pure context.
iSplitL "H".: Break apart a separating conjunction and pass theHhypothesis to the lhs goal.iSplitR "H".: Same asiSplitL, but passHto the rhs goal.iSplit.: Break apart a bidirectional entailment(⊣⊢) just like iffiLeft. iRight.: Same asleft. right.iExists x.. Same asexists x.xis from the pure context.iDestruct "H" as "[Hx _]".: Same asdestruct H as (Hx _). Useful for destructing conjunctions in a hypothesisiPoseProof "H" as "[Hx _]".: Same asiDestructbut leavesHiPoseProof (some_lemma with "arg1 arg2") as "H".: introduce some_lemma with args as hypothesis
iPureIntro.: Intros pure hypothesis⌜...⌝directly into coq context.iModIntro.: Remove update modality(|==>) or later modality in the goal.iMod "H" as "H1": Remove a modality from hypothesisHiNext.: Strip all later modalities from the goal and context. This requires a modality in the goaliCombine "Hl1 Hl2" as "Hl": Combine fractional ownership into full ownershipiCombine "Hl1 Hl2" as "Hl" gives "%Hvalid": and provide a validity hypothesisHvalid
iAssert (...)%I with "[H1 H2]" as "H4": assert...usingH1, H2and name it asH4....must beiProp.iAssert (⌜...⌝)%I as "%H4"for pure hypotheses.
iLöb as "IH" forall (x y).: Perform lob induction wrt toxandy.iInv "Hinv" as "H": OPen an invariantHinvasHiMod (inv_alloc Inv with "[...]") as "#Hinv": open an invariant
Heaplang tactics
https://gitlab.mpi-sws.org/iris/iris/-/blob/master/docs/heap_lang.md
wp_op.: symbolically execute exprswp_pures: execute pure expressions until possiblewp_alloc l as "Hl".: reason about allocating a location aslwp_bind l: Focus the specification onl.wp_apply ("H" with "[H1]"): same asiApply ("H" with "[H1]")wp_apply (wp_fork with [H1]): For Fork, split between each thread, and passH1to the first threadwp_apply (wp_par t1_post t2_post with "[Hl1] [Hl2]").: split the threads of a paralle composition (|||) with each postconditions
generic input characters
\ent, \vdash:⊢\sep:∗\and:∧\or:∨\ex:∃\all:∀\lc:⌜\rc:⌝\fun, \lambda, \lam:λ\"o:ö\mult:⋅\valid:✓\incl:≼\auth:●\\frag:◯
Written on July 31, 2025
