A Temporal Logic Subset as WS1S Fragment
Overview
In linear temporal logic there is an implicit notion of time. Just like quantifiers update the environment with the variable over which they quantify, temporal operators update this implicitly named variable. The notion of implicitly named variables is also a feature of modal logics and appears in description logics that are fragments of FOL used in knowledge bases.
Temporal logic can be used to reason about programs.
Example: the following formula describes a protocol for opening file using openRead operation, which allows file to be read but not written:
globally(openReadInvoked next( (isOpen (writeInvoked openReadInvoked) ) until closedInvoked)
( isOpen) globally ( ( isOpen) (readInvoked writeInvoked) )
openReadInvoked | x | |||||
isOpen | x | x | … | x | ||
writeInvoked | ||||||
closedInvoked | x |
Translation
If we assume that the time is given by a finite sequence (e.g. for terminating programs), we can translate temporal logic into WS1S.
Consider a temporal logic formula with operators next, globally, until, , , .
We fix a first-order variable and define translation function that maps a temporal logic formula into a WS1S formula that has as the free variable:
- (for a property , such as isOpen, openReadInvoked, …)
Note: if we use finite sequences to denote the executions, then at some point all truth variables become false (at the end of the sequence), because all sets are finite. Usually in linear temporal logic one uses infinite words instead.
Note: The above translation shows decidability, but in practice there are more efficient methods specialized for LTL
- Model Checking by Clarke, Grumberg, Peled
Translation into Automata
We can use either temporal logic over finite traces or full WS1S to describe properties. In any case, we can transform these properties into automata by using automata to decide ws1s.
Automaton for the example:
(open (read+write)* close)*