AXIOM A == f[3] = 8
LEMMA 3 \in DOMAIN f BY A
This means that axioms must be specified/theorems proven separately for functions' mappings and their domains, which is extra work. Is this an artifact of the logic (if 3 is outside f's domain, f[3] may be anything, and if I know it's 8, that doesn't mean that 3 is in the domain) or just a limitation of TLAPS?
Ron
On 14 Jun 2016, at 16:09, Ron Pressler <r...@paralleluniverse.co> wrote:
Hi.
I've noticed that TLAPS does not automatically deduce anything about a function's domain from facts about its mapping. E.g., the lemma in the following snippet fails:CONSTANT f
AXIOM A == g[3] = 8
LEMMA 3 \in DOMAIN g BY A
This means that axioms must be specified/theorems proven separately for functions' mappings and their domains, which is extra work. Is this an artifact of the logic (if 3 is outside f's domain, f[3] may be anything, and if I know it's 8, that doesn't mean that 3 is in the domain) or just a limitation of TLAPS?
Ron
--
You received this message because you are subscribed to the Google Groups "tlaplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+u...@googlegroups.com.
To post to this group, send email to tla...@googlegroups.com.
Visit this group at https://groups.google.com/group/tlaplus.
For more options, visit https://groups.google.com/d/optout.
Just knowing that g[3] = 8 doesn't allow you to infer that g is a function or to conclude anything about DOMAIN g, so TLAPS does the right thing. (For example, 42[3] denotes some unspecified value in TLA+, would you want to conclude that 42 is a function?) You want to state "type predicates" for the functions that appear in your specification – typically as ASSUME clauses for constant parameters, and as invariants for variables.
ASSUME A1 == f = [x \in DOMAIN f |-> f[x]]
ASSUME A2 == f[3] = 8
Correct, this is still too unspecific because f[3] denotes some value even if 3 is not an element of the domain of f. I was thinking of assumptions of the kindf \in [ 0 .. 10 -> Nat ]that help you reduce DOMAIN f to a specific set.
From what general properties of functions would you expect to be able
to deduce this?
RECURSIVE Yn(_, _, _)
Yn(X, f, n) == \* apply f, n times; X is the identity domain, i.e. X = DOMAIN Yn(X, f, 0)
LET Yn1 == Yn(X, f, n-1)
D == {x \in DOMAIN Yn1 : Yn1[x] \in DOMAIN f} IN
IF n = 0 THEN [x \in X |-> x]
ELSE [x \in D |-> f[Yn1[x]]]
Then (mostly as an exercise to learn TLAPS) I wanted to see how many axioms specifying Yn are required to be able to deduce various theorems about it; e.g.:
THEOREM \A f, X : \A m, n \in Nat : n >= m => DOMAIN Yn(X, f, n) \subseteq DOMAIN Yn(X, f, m)
THEOREM \A f, X : \A n \in Nat : \A x \in DOMAIN Yn(X, f, n+1) :
f[Yn(X, f, n)[x]] = Yn(X, f, n)[f[x]]
It turns out you need quite a few (at least I couldn't do it with less than five or so)...