Isomorphic Data Type Transformations Alessandro Coglio Stephen - - PowerPoint PPT Presentation

โ–ถ
isomorphic data type transformations
SMART_READER_LITE
LIVE PREVIEW

Isomorphic Data Type Transformations Alessandro Coglio Stephen - - PowerPoint PPT Presentation

Isomorphic Data Type Transformations Alessandro Coglio Stephen Westfold KESTREL INSTITUTE Isomorphic data type transformations are useful in program synthesis. some of these may be ! requirements specification isomorphic


slide-1
SLIDE 1

Isomorphic Data Type Transformations

Alessandro Coglio Stephen Westfold

KESTREL

INSTITUTE

slide-2
SLIDE 2

Isomorphic data type transformations are useful in program synthesis.

๐‘ž ๐‘ก! ๐‘ก"

. . .

intermediate specifications stepwise refinements ๐‘ก! requirements specification implementation code generation

(optional in ACL2)

some of these may be isomorphic transformations ยง represent finite sets as repetition-free ordered lists e.g. ยง turn unbounded integers into bounded integers (under preconditions) ยง add redundant record components for caching ยง change loop direction ยง ...

slide-3
SLIDE 3

Isomorphic data type transformations are useful in program synthesis. They are also useful in program analysis.

๐‘žโ€ฒ ๐‘ก!

"

๐‘ก#

"

. . .

๐‘ก$

"

existing program code representation code lifting anti-refinements, via โ€œinversesโ€ of the transformations for refinements higher-level representations, which may be easier to verify some of these may be isomorphic transformations, which are inherently reversible ยง represent repetition-free

  • rdered lists as finite sets

e.g. ยง turn bounded integers into unbounded integers (under preconditions) ยง remove redundant record components for caching ยง change loop direction ยง ...

slide-4
SLIDE 4

๐‘ก! ๐‘ก%

. . .

๐‘ก!

"

. . .

๐‘ก$

"

๐‘žโ€ฒ top-down derivation bottom-up anti-derivation equal or trivially equivalent end-to-end proof that ๐‘žโ€ฒ satisfies ๐‘ก! ๐‘ก#

"

. . .

๐‘ก$

"

๐‘žโ€ฒ ๐‘ก!

"

Isomorphic data type transformations are useful in program synthesis. They are also useful in program analysis, as well as in analysis-by-synthesis.

๐‘ž ๐‘ก# ๐‘ก%

. . .

๐‘ก!

slide-5
SLIDE 5

Consider two isomorphic sets (data types) ๐‘Œ and ๐‘Œ! with ๐œŠ โˆถ ๐‘Œ โŸถ ๐‘Œโ€ฒ and ๐œŠ"# โˆถ ๐‘Œโ€ฒ โŸถ ๐‘Œ. ๐œŠ ๐œŠ"# ๐‘Œ ๐‘Œโ€ฒ ๐œŠ"# โˆ˜ ๐œŠ = ๐‘—๐‘’$ ๐œŠ โˆ˜ ๐œŠ"# = ๐‘—๐‘’$!

slide-6
SLIDE 6

Consider two isomorphic sets (data types) ๐‘Œ and ๐‘Œ! with ๐œŠ โˆถ ๐‘Œ โŸถ ๐‘Œโ€ฒ and ๐œŠ"# โˆถ ๐‘Œโ€ฒ โŸถ ๐‘Œ. Consider two isomorphic sets (data types) ๐‘ and ๐‘โ€ฒ with ๐œ‘ โˆถ ๐‘ โŸถ ๐‘โ€ฒ and ๐œ‘"# โˆถ ๐‘โ€ฒ โŸถ ๐‘. ๐œŠ ๐œŠ"# ๐‘Œ ๐‘Œโ€ฒ ๐œŠ"# โˆ˜ ๐œŠ = ๐‘—๐‘’$ ๐œŠ โˆ˜ ๐œŠ"# = ๐‘—๐‘’$! ๐œ‘"# ๐œ‘ ๐‘ ๐‘โ€ฒ ๐œ‘"# โˆ˜ ๐œ‘ = ๐‘—๐‘’% ๐œ‘ โˆ˜ ๐œ‘"# = ๐‘—๐‘’%!

slide-7
SLIDE 7

Consider two isomorphic sets (data types) ๐‘Œ and ๐‘Œ! with ๐œŠ โˆถ ๐‘Œ โŸถ ๐‘Œโ€ฒ and ๐œŠ"# โˆถ ๐‘Œโ€ฒ โŸถ ๐‘Œ. Consider two isomorphic sets (data types) ๐‘ and ๐‘โ€ฒ with ๐œ‘ โˆถ ๐‘ โŸถ ๐‘โ€ฒ and ๐œ‘"# โˆถ ๐‘โ€ฒ โŸถ ๐‘. Consider a function ๐‘” โˆถ ๐‘Œ โŸถ ๐‘, a computation from inputs of type ๐‘Œ to outputs of type ๐‘. ๐œŠ ๐œŠ"# ๐‘Œ ๐‘Œโ€ฒ ๐œŠ"# โˆ˜ ๐œŠ = ๐‘—๐‘’$ ๐œŠ โˆ˜ ๐œŠ"# = ๐‘—๐‘’$! ๐œ‘"# ๐œ‘ ๐‘ ๐‘โ€ฒ ๐œ‘"# โˆ˜ ๐œ‘ = ๐‘—๐‘’% ๐œ‘ โˆ˜ ๐œ‘"# = ๐‘—๐‘’%! ๐‘”

slide-8
SLIDE 8

Consider two isomorphic sets (data types) ๐‘Œ and ๐‘Œ! with ๐œŠ โˆถ ๐‘Œ โŸถ ๐‘Œโ€ฒ and ๐œŠ"# โˆถ ๐‘Œโ€ฒ โŸถ ๐‘Œ. Consider two isomorphic sets (data types) ๐‘ and ๐‘โ€ฒ with ๐œ‘ โˆถ ๐‘ โŸถ ๐‘โ€ฒ and ๐œ‘"# โˆถ ๐‘โ€ฒ โŸถ ๐‘. Consider a function ๐‘” โˆถ ๐‘Œ โŸถ ๐‘, a computation from inputs of type ๐‘Œ to outputs of type ๐‘. We can mechanically construct a function ๐‘”! โˆถ ๐‘Œโ€ฒ โŸถ ๐‘โ€ฒ that makes the diagram commute. ๐œŠ ๐œŠ"# ๐‘Œ ๐‘Œโ€ฒ ๐œ‘"# ๐œ‘ ๐‘ ๐‘โ€ฒ ๐‘” ๐‘”โ€ฒ ๐œŠ"# โˆ˜ ๐œŠ = ๐‘—๐‘’$ ๐œŠ โˆ˜ ๐œŠ"# = ๐‘—๐‘’$! ๐œ‘"# โˆ˜ ๐œ‘ = ๐‘—๐‘’% ๐œ‘ โˆ˜ ๐œ‘"# = ๐‘—๐‘’%! ๐‘”โ€ฒ = ๐œ‘ โˆ˜ ๐‘” โˆ˜ ๐œŠ"# ๐‘” = ๐œ‘"# โˆ˜ ๐‘”โ€ฒ โˆ˜ ๐œŠ โŸบ

slide-9
SLIDE 9

๐‘”โ€ฒ ๐‘” ๐œŠ ๐œŠ"# ๐œ‘"# ๐œ‘ ๐‘Œ ๐‘Œโ€ฒ ๐‘ ๐‘โ€ฒ ๐‘”โ€ฒ = ๐œ‘ โˆ˜ ๐‘” โˆ˜ ๐œŠ"# ๐‘”โ€ฒ โ‰ก ๐œ‘ โˆ˜ ๐‘” โˆ˜ ๐œŠ"#

we could just define ๐‘”โ€ฒ like this, but that is not very interesting

Consider two isomorphic sets (data types) ๐‘Œ and ๐‘Œ! with ๐œŠ โˆถ ๐‘Œ โŸถ ๐‘Œโ€ฒ and ๐œŠ"# โˆถ ๐‘Œโ€ฒ โŸถ ๐‘Œ. Consider two isomorphic sets (data types) ๐‘ and ๐‘โ€ฒ with ๐œ‘ โˆถ ๐‘ โŸถ ๐‘โ€ฒ and ๐œ‘"# โˆถ ๐‘โ€ฒ โŸถ ๐‘. Consider a function ๐‘” โˆถ ๐‘Œ โŸถ ๐‘, a computation from inputs of type ๐‘Œ to outputs of type ๐‘. We can mechanically construct a function ๐‘”! โˆถ ๐‘Œโ€ฒ โŸถ ๐‘โ€ฒ that makes the diagram commute.

slide-10
SLIDE 10

๐‘”โ€ฒ ๐‘” ๐œŠ ๐œŠ"# ๐œ‘"# ๐œ‘ ๐‘Œ ๐‘Œโ€ฒ ๐‘ ๐‘โ€ฒ ๐‘”โ€ฒ = ๐œ‘ โˆ˜ ๐‘” โˆ˜ ๐œŠ"# Consider two isomorphic sets (data types) ๐‘Œ and ๐‘Œ! with ๐œŠ โˆถ ๐‘Œ โŸถ ๐‘Œโ€ฒ and ๐œŠ"# โˆถ ๐‘Œโ€ฒ โŸถ ๐‘Œ. Consider two isomorphic sets (data types) ๐‘ and ๐‘โ€ฒ with ๐œ‘ โˆถ ๐‘ โŸถ ๐‘โ€ฒ and ๐œ‘"# โˆถ ๐‘โ€ฒ โŸถ ๐‘. Consider a function ๐‘” โˆถ ๐‘Œ โŸถ ๐‘, a computation from inputs of type ๐‘Œ to outputs of type ๐‘. We can mechanically construct a function ๐‘”! โˆถ ๐‘Œโ€ฒ โŸถ ๐‘โ€ฒ that makes the diagram commute.

๐ฃ๐  ๐‘ ๐‘ฆ ๐ฎ๐ข๐Ÿ๐จ ๐‘ ๐‘ฆ ๐Ÿ๐ฆ๐ญ๐Ÿ ๐‘‘(๐‘ฆ, ๐‘”(๐‘’(๐‘ฆ))) ๐‘” ๐‘ฆ โ‰ก

๐‘ โІ ๐‘Œ ๐‘ โˆถ ๐‘Œ โŸถ ๐‘ ๐‘‘ โˆถ ๐‘Œ ร— ๐‘ โŸถ ๐‘ ๐‘’ โˆถ ๐‘Œ โŸถ ๐‘Œ

representative recursive definition โŠข ยฌ๐‘ ๐‘ฆ โŸน ๐œˆ(๐‘’(๐‘ฆ)) โ‰บ ๐œˆ(๐‘ฆ) ๐‘” terminates keep the same structure and add the conversions ๐‘”โ€ฒ ๐‘ฆ" โ‰ก ๐ฃ๐  ๐‘(๐œŠ&# ๐‘ฆ" ) ๐ฎ๐ข๐Ÿ๐จ ๐œ‘(๐‘(๐œŠ&# ๐‘ฆ" )) ๐Ÿ๐ฆ๐ญ๐Ÿ ๐œ‘(๐‘‘(๐œŠ&# ๐‘ฆ" , ๐œ‘&# ๐‘”โ€ฒ(๐œŠ ๐‘’(๐œŠ&# ๐‘ฆ" ) ) ))

slide-11
SLIDE 11

๐‘”โ€ฒ ๐‘” ๐œŠ ๐œŠ"# ๐œ‘"# ๐œ‘ ๐‘Œ ๐‘Œโ€ฒ ๐‘ ๐‘โ€ฒ Consider two isomorphic sets (data types) ๐‘Œ and ๐‘Œ! with ๐œŠ โˆถ ๐‘Œ โŸถ ๐‘Œโ€ฒ and ๐œŠ"# โˆถ ๐‘Œโ€ฒ โŸถ ๐‘Œ. Consider two isomorphic sets (data types) ๐‘ and ๐‘โ€ฒ with ๐œ‘ โˆถ ๐‘ โŸถ ๐‘โ€ฒ and ๐œ‘"# โˆถ ๐‘โ€ฒ โŸถ ๐‘. Consider a function ๐‘” โˆถ ๐‘Œ โŸถ ๐‘, a computation from inputs of type ๐‘Œ to outputs of type ๐‘. We can mechanically construct a function ๐‘”! โˆถ ๐‘Œโ€ฒ โŸถ ๐‘โ€ฒ that makes the diagram commute.

๐ฃ๐  ๐‘ ๐‘ฆ ๐ฎ๐ข๐Ÿ๐จ ๐‘ ๐‘ฆ ๐Ÿ๐ฆ๐ญ๐Ÿ ๐‘‘(๐‘ฆ, ๐‘”(๐‘’(๐‘ฆ))) ๐‘” ๐‘ฆ โ‰ก

๐‘ โІ ๐‘Œ ๐‘ โˆถ ๐‘Œ โŸถ ๐‘ ๐‘‘ โˆถ ๐‘Œ ร— ๐‘ โŸถ ๐‘ ๐‘’ โˆถ ๐‘Œ โŸถ ๐‘Œ

representative recursive definition โŠข ยฌ๐‘ ๐‘ฆ โŸน ๐œˆ(๐‘’(๐‘ฆ)) โ‰บ ๐œˆ(๐‘ฆ) ๐‘” terminates keep the same structure and add the conversions ๐‘”โ€ฒ ๐‘ฆ" โ‰ก ๐ฃ๐  ๐‘(๐œŠ&# ๐‘ฆ" ) ๐ฎ๐ข๐Ÿ๐จ ๐œ‘(๐‘(๐œŠ&# ๐‘ฆ" )) ๐Ÿ๐ฆ๐ญ๐Ÿ ๐œ‘(๐‘‘(๐œŠ&# ๐‘ฆ" , ๐œ‘&# ๐‘”โ€ฒ(๐œŠ ๐‘’(๐œŠ&# ๐‘ฆ" ) ) )) ๐œˆ" โ‰ก ๐œˆ โˆ˜ ๐œŠ&# ๐‘”โ€ฒ terminates because ๐‘” does

โŠข ๐‘”โ€ฒ = ๐œ‘ โˆ˜ ๐‘” โˆ˜ ๐œŠ"#

b y i n d u c t i

  • n

automatic

slide-12
SLIDE 12

๐‘”โ€ฒ ๐‘” ๐œŠ ๐œŠ"# ๐œ‘"# ๐œ‘ ๐‘Œ ๐‘Œโ€ฒ ๐‘ ๐‘โ€ฒ โŠข ๐‘”โ€ฒ = ๐œ‘ โˆ˜ ๐‘” โˆ˜ ๐œŠ"#

๐‘”โ€ฒ ๐‘ฆ" โ‰ก ๐ฃ๐  ๐‘(๐œŠ&# ๐‘ฆ" ) ๐ฎ๐ข๐Ÿ๐จ ๐œ‘(๐‘(๐œŠ&# ๐‘ฆ" )) ๐Ÿ๐ฆ๐ญ๐Ÿ ๐œ‘(๐‘‘(๐œŠ&# ๐‘ฆ" , ๐œ‘&# ๐‘”โ€ฒ(๐œŠ ๐‘’(๐œŠ&# ๐‘ฆ" ) ) )) ๐ฃ๐  ๐‘ ๐‘ฆ ๐ฎ๐ข๐Ÿ๐จ ๐‘ ๐‘ฆ ๐Ÿ๐ฆ๐ญ๐Ÿ ๐‘‘(๐‘ฆ, ๐‘”(๐‘’(๐‘ฆ))) ๐‘” ๐‘ฆ โ‰ก goal: no trace of ๐‘Œ, ๐‘, ๐œŠ, ๐œŠ&#, ๐œ‘, ๐œ‘&# keep the same structure and add the conversions automatic expand the definitions and rewrite/simplify user-guided ๐ฃ๐  ๐‘โ€ฒ ๐‘ฆโ€ฒ ๐ฎ๐ข๐Ÿ๐จ ๐‘โ€ฒ ๐‘ฆโ€ฒ ๐Ÿ๐ฆ๐ญ๐Ÿ ๐‘‘โ€ฒ(๐‘ฆโ€ฒ, ๐‘”โ€ฒโ€ฒ(๐‘’โ€ฒ(๐‘ฆโ€ฒ))) ๐‘”โ€ฒโ€ฒ ๐‘ฆ" โ‰ก โŠข ๐‘”"" = ๐‘”โ€ฒ

slide-13
SLIDE 13

keep the same structure and add the conversions expand the definitions and rewrite/simplify ๐‘” ๐‘ฆ โ‰ก โ€ฆ ๐‘”โ€ฒ ๐‘ฆโ€ฒ โ‰ก โ€ฆ ๐‘”โ€ฒโ€ฒ ๐‘ฆ" โ‰ก โ€ฆ

This is a general method: automatically create an isomorphic version and semi-automatically rewrite/simplify it. We can do it for ๐‘”, ๐‘”

#, ๐‘” 0, etc.,

  • btaining ๐‘”โ€ฒ, ๐‘”โ€ฒโ€ฒ, ๐‘”

#โ€ฒ, ๐‘” #โ€ฒโ€ฒ, ๐‘” 0โ€ฒ, ๐‘” 0โ€ฒโ€ฒ, etc.,

Consider a function ๐‘• that calls ๐‘”, ๐‘”

#, ๐‘” 0, etc.

๐‘• โ€ฆ โ‰ก โ€ฆ ๐‘” โ€ฆ โ€ฆ

We can apply the same general method to ๐‘•.

keep the same structure and add the conversions ๐‘•โ€ฒ โ€ฆ โ‰ก โ€ฆ ๐œ‘(๐‘”(๐œŠ&# โ€ฆ )) โ€ฆ expand the definitions and rewrite/simplify ๐‘•โ€ฒโ€ฒ โ€ฆ โ‰ก โ€ฆ

If ๐‘• manipulates the data being transformed

  • nly through ๐‘”, ๐‘”

#, ๐‘” 0, etc., we can automate

the rewriting/simplification step as well. โŠข ๐‘” = ๐œ‘"# โˆ˜ ๐‘”โ€ฒ โˆ˜ ๐œŠ

slide-14
SLIDE 14

keep the same structure and add the conversions expand the definitions and rewrite/simplify ๐‘” ๐‘ฆ โ‰ก โ€ฆ ๐‘”โ€ฒ ๐‘ฆโ€ฒ โ‰ก โ€ฆ ๐‘”โ€ฒโ€ฒ ๐‘ฆ" โ‰ก โ€ฆ

This is a general method: automatically create an isomorphic version and semi-automatically rewrite/simplify it. We can do it for ๐‘”, ๐‘”

#, ๐‘” 0, etc.,

  • btaining ๐‘”โ€ฒ, ๐‘”โ€ฒโ€ฒ, ๐‘”

#โ€ฒ, ๐‘” #โ€ฒโ€ฒ, ๐‘” 0โ€ฒ, ๐‘” 0โ€ฒโ€ฒ, etc.,

Consider a function ๐‘• that calls ๐‘”, ๐‘”

#, ๐‘” 0, etc.

We can apply the same general method to ๐‘•. If ๐‘• manipulates the data being transformed

  • nly through ๐‘”, ๐‘”

#, ๐‘” 0, etc., we can automate

the rewriting/simplification step as well. And we can do everything in one step.

keep the same structure and replace ๐‘” with ๐‘”โ€ฒ etc. ๐‘• โ€ฆ โ‰ก โ€ฆ ๐‘” โ€ฆ โ€ฆ ๐‘•โ€ฒ โ€ฆ โ‰ก โ€ฆ ๐‘”โ€ฒ โ€ฆ โ€ฆ

slide-15
SLIDE 15

(isodata ๐‘” ...) (simplify ๐‘”โ€ฒ ...) ๐‘” ๐‘ฆ โ‰ก โ€ฆ ๐‘”โ€ฒ ๐‘ฆโ€ฒ โ‰ก โ€ฆ ๐‘”โ€ฒโ€ฒ ๐‘ฆ" โ‰ก โ€ฆ

We use isodata to initiate the isomorphic transformation. We use propagate-iso to propagate the isomorphic transformation.

(propagate-iso ๐‘• ...) ๐‘• โ€ฆ โ‰ก โ€ฆ ๐‘” โ€ฆ โ€ฆ ๐‘•โ€ฒ โ€ฆ โ‰ก โ€ฆ ๐‘”โ€ฒ โ€ฆ โ€ฆ

The simplify transformation was described at ACL2-2017.

slide-16
SLIDE 16

(propagate-iso ๐‘• ...)

We use propagate-iso to propagate the isomorphic transformation.

๐‘• โ€ฆ โ‰ก โ€ฆ ๐‘” โ€ฆ โ€ฆ ๐‘•โ€ฒ โ€ฆ โ‰ก โ€ฆ ๐‘”โ€ฒ โ€ฆ โ€ฆ (isodata ๐‘” ...) (simplify ๐‘”โ€ฒ ...) ๐‘” ๐‘ฆ โ‰ก โ€ฆ ๐‘”โ€ฒ ๐‘ฆโ€ฒ โ‰ก โ€ฆ ๐‘”โ€ฒโ€ฒ ๐‘ฆ" โ‰ก โ€ฆ

We use isodata to initiate the isomorphic transformation.

๐œŠ ๐œŠ&# ๐‘Œ ๐‘Œโ€ฒ ๐œ‘ ๐œ‘&# ๐‘ ๐‘โ€ฒ (defiso ๐‘Œ ๐‘Œโ€ฒ ๐œŠ ๐œŠ&# ...) (defiso ๐‘ ๐‘โ€ฒ ๐œ‘ ๐œ‘&# ...) ๐œ‚ ๐œ‚&# ๐‘Ž ๐‘Žโ€ฒ

We use defiso to establish the isomorphic mappings.

(defiso ๐‘Ž ๐‘Žโ€ฒ ๐œ‚ ๐œ‚&# ...) and for other types and for ๐‘”

#, ๐‘” ', etc.

and for ๐‘•#, ๐‘•', etc.

slide-17
SLIDE 17

propagate-iso

1. Find events to propagate to

  • User supplied limits
  • Dependent events: function definitions and theorems

2. Type analysis: which arguments and results to be transformed

  • Arguments: guards
  • Results: typing theorems and body of definition

3. Dependent isomorphisms

  • Subtypes, record/product types, recursive types: e.g. list, map types

4. Translation: substitution

  • Add isomorphism theorems for newly generated functions

5.

  • Hints. Hard to guarantee they will work
  • Three rulesets: forward, backward, general (typing, defiso rules)
  • Allow user to augment or override automatically generated hints
slide-18
SLIDE 18

Dependent Isomorphism: Deriving isomorphism from predicate

๐ต๐‘š๐‘š๐œŠ ๐‘š โ‰ก ๐ฃ๐  ๐‘๐‘ข๐‘๐‘› ๐‘š ๐ฎ๐ข๐Ÿ๐จ ๐‘ ๐‘š ๐Ÿ๐ฆ๐ญ๐Ÿ ๐‘‘(๐‘Œ(๐‘‘๐‘๐‘  ๐‘š ), ๐ต๐‘š๐‘š๐‘Œ ๐‘‘๐‘’๐‘  ๐‘š ) ๐‘œ๐‘ฃ๐‘š๐‘š ๐‘(๐‘š) โŸน ๐‘ ๐‘š = ๐‘œ๐‘—๐‘š ๐ฃ๐  ๐‘๐‘ข๐‘๐‘› ๐‘š ๐ฎ๐ข๐Ÿ๐จ ๐‘œ๐‘—๐‘š ๐Ÿ๐ฆ๐ญ๐Ÿ ๐น ๐น = ๐‘‘(๐‘Œ(๐‘‘๐‘๐‘  ๐‘š ), ๐ต๐‘š๐‘š๐‘Œ ๐‘‘๐‘’๐‘  ๐‘š ) โˆง ๐‘‘๐‘๐‘œ๐‘ก๐‘ž(๐น) โˆง ๐‘Œ!(๐‘‘๐‘๐‘  ๐น ) โˆง ๐ต๐‘š๐‘š๐‘Œโ€ฒ(๐‘‘๐‘’๐‘  ๐น ) โˆด ๐น = ๐‘‘๐‘๐‘œ๐‘ก(๐œŠ ๐‘‘๐‘๐‘  ๐‘š , ๐ต๐‘š๐‘š๐œŠ(๐‘‘๐‘’๐‘  ๐‘š )) ๐ต๐‘š๐‘š๐œŠ ๐‘š โ‰ก ๐ฃ๐  ๐‘๐‘ข๐‘๐‘› ๐‘š ๐ฎ๐ข๐Ÿ๐จ ๐‘œ๐‘—๐‘š ๐Ÿ๐ฆ๐ญ๐Ÿ ๐‘‘๐‘๐‘œ๐‘ก(๐œŠ(๐‘‘๐‘๐‘  ๐‘š ), ๐ต๐‘š๐‘š๐œŠ(๐‘‘๐‘’๐‘  ๐‘š )) Consider two isomorphic sets (data types) ๐‘Œ and ๐‘Œ! with ๐œŠ โˆถ ๐‘Œ โŸถ ๐‘Œโ€ฒ and ๐œŠ"# โˆถ ๐‘Œโ€ฒ โŸถ ๐‘Œ. Consider a predicate ๐ต๐‘š๐‘š๐‘Œ ๐‘š โ‰ก ๐ฃ๐  ๐‘๐‘ข๐‘๐‘› ๐‘š ๐ฎ๐ข๐Ÿ๐จ ๐‘œ๐‘ฃ๐‘š๐‘š ๐‘š ๐Ÿ๐ฆ๐ญ๐Ÿ ๐‘Œ(๐‘‘๐‘๐‘  ๐‘š ) โˆง ๐ต๐‘š๐‘š๐‘Œ(๐‘‘๐‘’๐‘ (๐‘š)). Then define predicate ๐ต๐‘š๐‘š๐‘Œโ€ฒ(๐‘š) โ‰ก ๐ฃ๐  ๐‘๐‘ข๐‘๐‘› ๐‘š ๐ฎ๐ข๐Ÿ๐จ ๐‘œ๐‘ฃ๐‘š๐‘š ๐‘š ๐Ÿ๐ฆ๐ญ๐Ÿ ๐‘Œ!(๐‘‘๐‘๐‘  ๐‘š ) โˆง ๐ต๐‘š๐‘š๐‘Œโ€ฒ(๐‘‘๐‘’๐‘ (๐‘š)). We want to find definitions for the isomorphisms ๐ต๐‘š๐‘š๐œŠ โˆถ ๐ต๐‘š๐‘š๐‘Œ โŸถ ๐ต๐‘š๐‘š๐‘Œโ€ฒ and ๐ต๐‘š๐‘š๐œŠ"# โˆถ ๐ต๐‘š๐‘š๐‘Œโ€ฒ โŸถ ๐ต๐‘š๐‘š๐‘Œ. ๐‘œ๐‘ฃ๐‘š๐‘š ๐‘š ๐‘Œ!(๐‘‘๐‘๐‘  ๐‘š ) โˆง ๐ต๐‘š๐‘š๐‘Œโ€ฒ(๐‘‘๐‘’๐‘ (๐‘š))

slide-19
SLIDE 19

(defun P-map-p (m) (if (atom m) (null m) (and (consp (car m)) (P (caar m)) (natp (cdar m)) (P-map-p (cdr m)))) (defun P'-map-p (m) (if (atom m) (null m) (and (consp (car m)) (P' (caar m)) (natp (cdar m)) (P'-map-p (cdr m)))) (defun P-map-to-P'-map (m) (if (atom m) nil (cons (cons (P-to-P' (caar m)) (cdar m)) (P-map-to-P'-map (cdr m))))

Derive P-map-to-P'-map else clause

(consp (car m)) --> (cons (cons ? ?) ?) (P' (caar m)) --> (cons (cons (P-to-P' (caar m)) ?) ?) (natp (cdar m)) --> (cons (cons ? (cdar m)) ?) identity isomorphism (P'-map-p (cdr m))--> (cons (cons ? ?) (P-map-to-P'-map (cdr m))) Combined: (cons (cons (P-to-P' (caar m)) (cdar m)) (P-map-to--map (cdr m)))

Consider two isomorphic sets (data types) P and P'with P-to-P': P โŸถ P'

slide-20
SLIDE 20

Demo: efficient value caching with invariant maintenance.

ACL2 !> (defiso ...) (isodata ...) (propagate-iso ...)

slide-21
SLIDE 21

Drone planner

  • Set of drones has to visit a set of sites
  • Partial plan then execute cycle until all sites visited
  • Each drone produces candidate plans for itself
  • Coordinator filters plans to minimize redundancy
  • Each drone has a state
  • System state is a list of drone states plus coordinator state

Coordinator

Drone 1 Drone 2