@@ -98,7 +98,7 @@ stepBehv (Behaviour name _ i _ conds cases _ _ _) =
9898 <> [ stepType <> " " <> stateVar <> " " <> parens (name' <> " " <> envVar <> " " <> stateVar <> " " <> arguments i)]
9999
100100
101- -- | inductive definition of reachable states
101+ -- | definition of reachable states
102102reachable :: T. Text
103103reachable = definition
104104 reachableType args value
@@ -109,6 +109,7 @@ reachable = definition
109109 stateVar' <> " " <> stateVar
110110 stateVar' = stateVar <> " '"
111111
112+ -- | specialization of generic multistep
112113multistep :: T. Text
113114multistep = definition
114115 multistepType args value
@@ -117,9 +118,7 @@ multistep = definition
117118 value = multistepType <> " " <> stepType <> " " <> stateVar <> " " <> stateVar'
118119 stateVar' = stateVar <> " '"
119120
120- multistepType :: T. Text
121- multistepType = " multistep"
122-
121+ -- | definition of reachable states from initial state
123122reachableFromInit :: T. Text
124123reachableFromInit = definition
125124 reachableFromInitType args value
@@ -130,17 +129,12 @@ reachableFromInit = definition
130129 stateVar <> " " <> stateVar'
131130 stateVar' = stateVar <> " '"
132131
133- reachableFromInitType :: T. Text
134- reachableFromInitType = " reachableFromInit"
135-
136- stepMultistepType :: T. Text
137- stepMultistepType = " step_multi_step"
138-
132+ -- | specialization of generic multistep lemma
139133stepMultistep :: T. Text
140134stepMultistep = definition
141135 stepMultistepType " " $ stepMultistepType <> " " <> stepType
142136
143-
137+ -- | definition of preconditions for initial state
144138initPred :: Constructor -> T. Text
145139initPred (Constructor name i@ (Interface _ decls) _ conds _ _ _ ) = inductive
146140 initType " " (stateType <> " -> " <> " Prop" ) [body]
@@ -157,37 +151,6 @@ initPred (Constructor name i@(Interface _ decls) _ conds _ _ _ ) = inductive
157151 then " "
158152 else interface i) <> " ,"
159153
160-
161- -- | non-recursive constructor for the reachable relation
162- baseCase :: Constructor -> T. Text
163- baseCase (Constructor name i@ (Interface _ decls) _ conds _ _ _ ) =
164- T. pack name <> baseSuffix <> " : " <> universal <> " \n " <> constructorBody
165- where
166- baseval = parens $ T. pack name <> " " <> envVar <> " " <> arguments i
167- constructorBody = (indent 2 ) . implication . concat $
168- [ coqprop <$> conds
169- , [reachableType <> " " <> baseval <> " " <> baseval]
170- ]
171- universal =
172- " forall " <> envDecl <> " " <>
173- (if null decls
174- then " "
175- else interface i) <> " ,"
176-
177- -- | recursive constructor for the reachable relation
178- reachableStep :: T. Text
179- reachableStep =
180- reachStep <> " : forall "
181- <> envDecl <> " "
182- <> parens (baseVar <> " " <> stateVar <> " " <> nextVar <> " : " <> stateType) <> " ,\n "
183- <> constructorBody where
184-
185- constructorBody = (indent 2 ) . implication $
186- [ reachableType <> " " <> baseVar <> " " <> stateVar ]
187- <> [stepType <> " " <> stateVar <> " " <> nextVar ]
188- <> [reachableType <> " " <> baseVar <> " " <> nextVar ]
189-
190-
191154-- | definition of a base state
192155base :: Store -> Constructor -> T. Text
193156base store (Constructor name i _ _ _ _ updates) =
@@ -519,9 +482,18 @@ stepType = "step"
519482initType :: T. Text
520483initType = " init"
521484
485+ multistepType :: T. Text
486+ multistepType = " multistep"
487+
522488reachableType :: T. Text
523489reachableType = " reachable"
524490
491+ reachableFromInitType :: T. Text
492+ reachableFromInitType = " reachableFromInit"
493+
494+ stepMultistepType :: T. Text
495+ stepMultistepType = " step_multi_step"
496+
525497reachStep :: T. Text
526498reachStep= " reach_step"
527499
0 commit comments