⚙️ ISABELLE RUNE DIFFICULTY: Apprentice Behavioral

The State

Allow an object to alter its behavior when its internal state changes. The object will appear to change its class.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: State
ARCANUM SCHOOL: Transmutation // Metamorphosis
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// ISABELLE PATTERN //
theory State
  imports Main
begin

datatype wizard_phase = Apprentice | Master | Archmage

fun cast_power :: "wizard_phase \<Rightarrow> nat" where
  "cast_power Apprentice = 10"
| "cast_power Master = 50"
| "cast_power Archmage = 100"

end
Runic Tags: #isabelle #hol #transmutation #design-patterns