andreinaku / SpyType

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

maude rewrites hang for long basetypes

andreinaku opened this issue · comments

(T1 <= int + float) /\ (T1 <= dict< top, top > + bytes + str + frozenset< top > + bytearray + tuple< top > + list< top > + memoryview + range + set< top >) .
  • use Sized in maude specs?
    solution: use strategy 2 and divide basetypes into sums of maximum 5 elements, when necessary.
    strategy 2:
one(Step1) ! ; one(Step2) ! ; one(Step3) ! ; one(Step4) ! ; Step5 ! ; Step6 ! .

example:
instead of

  eq c20 = ((T1 <= int + float) /\ (T1 <= dict< top, top > + bytes + str + int + frozenset< top > + bytearray + tuple< top > + list< top > + memoryview + range + set< top >)) .

use

  eq c20 = ((T1 <= int + float) /\ (T1 <= dict< top, top > + bytes + str + int + frozenset< top >)) \/ ((T1 <= int + float) /\ (T1 <= bytearray + tuple< top > + list< top > + memoryview + range + set< top >)) .

a6b7b53

bulk actions not needed
it was actually faster to introduce a new maude rule

rl [Step8]: ((C[S]) && ((T <= T1 + T2)[S])) => ((C[S]) && ((T <= T1)[S])) || ((C[S]) && ((T <= T2)[S])) .

and use this strategy for state constraint solve

strat3 = 'one(Step1) ! ; one(Step2) ! ; one(Step8) ! ; one(Step3) ! ; one(Step4) ! ; Step5 ! ; Step6 ! '

a fix was added in b4ec90a
init.maude now replaced by new.maude, a rewrite where container types are operators of the type ContainerType.
this way, it is easier to add rewrite rules for container types, because there is no need of treating them separately. the only separate one is dict, which can contain 2 basetypes.