-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How does logic.past work? #11
Comments
About past LTL, please refer to the literature cited in the docstring of https://github.com/tulip-control/omega/blob/v0.3.1/omega/logic/past.py#L4-L27 A usage example of this module is the function https://github.com/johnyf/openpromela/blob/8a74b37b2b481cb9b1914fd9b2b4b38bb8162a73/openpromela/logic.py#L2272 of the package The function https://github.com/tulip-control/omega/blob/v0.3.1/omega/logic/past.py#L245 takes a formula that may contain past LTL operators and returns a translated The past operators are listed in the documentation https://github.com/tulip-control/omega/blob/v0.3.1/doc/doc.md#temporal-logic-syntax
For example, assuming that >>> from omega.logic import past
>>> past.translate('-X u')
({'u_prev1': {'type': 'bool', 'dom': None, 'owner': 'sys'}},
'u_prev1',
'u_prev1',
'((X u_prev1) <=> u)',
[]) The function dvars, r, init, trans, win
Translating the operator "strong previous": >>> past.translate('--X u')
({'u_prev1': {'type': 'bool', 'dom': None, 'owner': 'sys'}},
'u_prev1',
'(~ u_prev1)',
'((X u_prev1) <=> u)',
[]) Compared to the operator "weak previous", the operator "strong previous" is
Translating the operator "historically": >>> past.translate('-[] u')
({'_aux0': {'type': 'bool', 'dom': None, 'owner': 'sys'}},
'(~ _aux0)',
'(_aux0 <=> ( ~ u ))',
'((X _aux0) <=> ( (X ( ~ u )) \\/ ((X True) /\\ _aux0)))',
[]) The translation of the formula Translating the operator "once": >>> past.translate('-<> u')
({'_aux0': {'type': 'bool', 'dom': None, 'owner': 'sys'}},
'_aux0',
'(_aux0 <=> u)',
'((X _aux0) <=> ( (X u) \\/ ((X True) /\\ _aux0)))',
[]) The translation of the formula Translating the operator "since": >>> past.translate('a S b')
({'_aux0': {'type': 'bool', 'dom': None, 'owner': 'sys'}},
'_aux0',
'(_aux0 <=> b)',
'((X _aux0) <=> ( (X b) \\/ ((X a) /\\ _aux0)))',
[]) The translation of the formula The operator "until" can also be translated (for a closed system): >>> past.translate('a U b', until=True)
({'_aux0': {'type': 'bool', 'dom': None, 'owner': 'sys'}},
'_aux0',
'True',
'(_aux0 <=> ( (b) \\/ ((a) /\\ (X _aux0))))',
['((b) \\/ ~ _aux0)']) An example with more than one temporal operator of past LTL: >>> past.translate('-[] (a S b)')
({'_aux0': {'type': 'bool', 'dom': None, 'owner': 'sys'},
'_aux1': {'type': 'bool', 'dom': None, 'owner': 'sys'}},
'(~ _aux1)',
'((_aux0 <=> b)) /\\ ((_aux1 <=> ( ~ _aux0 )))',
'(((X _aux0) <=> ( (X b) \\/ ((X a) /\\ _aux0)))) /\\ (((X _aux1) <=> ( (X ( ~ _aux0 )) \\/ ((X True) /\\ _aux1))))',
[]) |
@johnyf Thanks for the detailed reply! I think I understand now. Just to confirm, is the following correct: >>> past.translate('a S b')
({'_aux0': {'type': 'bool', 'dom': None, 'owner': 'sys'}},
'_aux0',
'(_aux0 <=> b)',
'((X _aux0) <=> ( (X b) \\/ ((X a) /\\ _aux0)))',
[]) This is really saying that In other words, I think another way to say this is that
(where I existentially quantified _aux0 to project it out) |
This is correct provided that the translated formula Stutter-invariant temporal existential quantification in the temporal logic of actions, TLA+ is denoted by If we denote stutter-sensitive temporal existential quantification in raw TLA+ by \ee _aux0: /\ _aux0
/\ (_aux0 <=> b)
/\ []((_aux0') <=> ((b') \/ ((a') /\ _aux0))) The translation of past temporal operators is based on Section 5 of this paper. Quantified propositional temporal logic (QPTL) is described in this paper. Another example would be translating the formula >>> past.translate('[] (a S b)')
({'_aux0': {'type': 'bool', 'dom': None, 'owner': 'sys'}},
'( [] _aux0 )',
'(_aux0 <=> b)',
'((X _aux0) <=> ( (X b) \\/ ((X a) /\\ _aux0)))',
[]) The translated formula in raw TLA+ would be ( TranslatedFormula ==
\ee _aux0:
/\ [] _aux0
/\ _aux0 <=> b
/\ [](_aux0' <=> (b' \/ (a' /\ _aux0))) The formula OriginalFormula == [](a S b)
THEOREM
OriginalFormula <=> TranslatedFormula The TLA+ proof language is described in this document. The variable Realizability of properties with So GR(1) synthesis can be used when past temporal operators occur, after applying the translation of the past temporal operators and the addition of the auxiliary, history-determined variables. The preservation of realizability when unhiding history-determined variables is described in detail in the module A definition of stutter-sensitive temporal quantification is included on page 4 of the module |
Hi, I was studying about past LTL operators, and ran into this repo. Could someone explain how the translate routine omega.logic.past works? Specifically, I wonder what is the returned tuple value and what does "initial condition" mean?
The text was updated successfully, but these errors were encountered: