• Save
Alloy20110818
Upcoming SlideShare
Loading in...5
×
 

Alloy20110818

on

  • 738 views

 

Statistics

Views

Total Views
738
Views on SlideShare
635
Embed Views
103

Actions

Likes
0
Downloads
0
Comments
0

2 Embeds 103

http://chikoski.info 102
http://www.tumblr.com 1

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Alloy20110818 Alloy20110818 Presentation Transcript

  • N. Shimizu <chikoski@gmail.com> 2011/08/18 
AlloyN. Shimizu (chikoski@gmail.com / @chikoski)
  • N. Shimizu <chikoski@gmail.com> 2011/08/18•  #• 
  • N. Shimizu <chikoski@gmail.com> 2011/08/18•  #   #  50 #• 6 #   #   #
  • N. Shimizu <chikoski@gmail.com> 2011/08/18https://sites.google.com/site/softwareabstractionsja/
  • N. Shimizu <chikoski@gmail.com> 2011/08/18Alloy Mac OS• Java 1.5 #• Lion Java #   #  http://support.apple.com/kb/DL1421
  • N. Shimizu <chikoski@gmail.com> 2011/08/18Alloy Mac OS
  • N. Shimizu <chikoski@gmail.com> 2011/08/18Alloy Mac OS (cont.)
  • N. Shimizu <chikoski@gmail.com> 2011/08/18Alloy Mac OS (cont.)•  .app # 1.  Finder # 2.  + +a# 3.  # 4.  .app #
  • N. Shimizu <chikoski@gmail.com> 2011/08/18Alloy Mac OS (cont.)% mkdir alloy#% cd alloy#% mv ~/Downloads/alloy4.2-rc.jar alloy.jar#% java -jar alloy.jar
  • N. Shimizu <chikoski@gmail.com> 2011/08/18Alloy Mac OS (cont.)
  • N. Shimizu <chikoski@gmail.com> 2011/08/18
  • N. Shimizu <chikoski@gmail.com> 2011/08/18
  • N. Shimizu <chikoski@gmail.com> 2011/08/18
  • N. Shimizu <chikoski@gmail.com> 2011/08/181.  #2.  ‘Execute’ #3.  2 #4.  “Instance”
  • N. Shimizu <chikoski@gmail.com> 2011/08/182.1:module tour/addressBook1#sig Name, Addr {}#sig Book{# #addr: Name -> lone Addr#}#pred show{}#run show for 3 but 1 Book
  • N. Shimizu <chikoski@gmail.com> 2011/08/181.  Show #2.  ‘Theme’ “Load Sample Theem” #3.  book/chapter2/theme.thm
  • N. Shimizu <chikoski@gmail.com> 2011/08/18
  • N. Shimizu <chikoski@gmail.com> 2011/08/183module tour/addressBook1#sig Name, Addr {}#sig Book{# #addr: Name -> lone Addr#}#pred show{}#run show for 3 but 1 Book
  • N. Shimizu <chikoski@gmail.com> 2011/08/18 b -> n -> amodule tour/addressBook1#sig Name, Addr {}#sig Book{# #addr: Name -> lone Addr#}#pred show{}#run show for 3 but 1 Book
  • N. Shimizu <chikoski@gmail.com> 2011/08/18addr: b -> n -> aBook Name Addr b0 n0 a0 b0 n1 a1 b0 n2 a1 b1 n0 a2 b1 n3 a2 b1 n4 a1
  • N. Shimizu <chikoski@gmail.com> 2011/08/18module tour/addressBook1#sig Name, Addr {}#sig Book{# #addr: Name -> lone Addr#}#pred show{}#run show for 3 but 1 Book
  • N. Shimizu <chikoski@gmail.com> 2011/08/18module tour/addressBook1#sig Name, Addr {}#sig Book{# #addr: Name -> lone Addr#}#pred show{}#run show for 3 but 1 Book
  • N. Shimizu <chikoski@gmail.com> 2011/08/18 
module tour/addressBook1#sig Name, Addr {}#sig Book{# #addr: Name -> lone Addr#}#pred show{}#run show for 3 but 1 Book
  • N. Shimizu <chikoski@gmail.com> 2011/08/18for•  #•  3#• for 3 but 1 Book#   #   Book 1#
  • N. Shimizu <chikoski@gmail.com> 2011/08/18 
module tour/addressBook1#sig Name, Addr {}#sig Book{# #addr: Name -> lone Addr#}#pred show{}#run show for 3 but 1 Book
  • N. Shimizu <chikoski@gmail.com> 2011/08/18pred show(b: Book){# ##(b.addr) > 1#}
  • N. Shimizu <chikoski@gmail.com> 2011/08/18#pred show(b: Book){# ##(b.addr) > 1#}
  • N. Shimizu <chikoski@gmail.com> 2011/08/18
  • N. Shimizu <chikoski@gmail.com> 2011/08/18pred show(b: Book){# ##(b.addr) > 1# #some n:Name | #n.(b.addr) > 1#}
  • N. Shimizu <chikoski@gmail.com> 2011/08/18some x: e | F• e x F #• some n:Name | #n.(b.addr) > 1#  Name n #  #n.(b.addr) > 1 #
  • N. Shimizu <chikoski@gmail.com> 2011/08/18addr: b -> n -> aBook Name Addr b0 n0 a0 b0 n1 a1 b0 n2 a1 b1 n0 a2 b1 n3 a2 b1 n4 a1
  • N. Shimizu <chikoski@gmail.com> 2011/08/18# n.(b.addr) > 1Book Name Addr b0 n0 a0 b0 n1 a1 b0 n2 a1
  • N. Shimizu <chikoski@gmail.com> 2011/08/18
  • N. Shimizu <chikoski@gmail.com> 2011/08/18sig Book{# #addr: Name -> lone Addr#}#pred show(b: Book){# ##(b.addr) > 1# #some n:Name | #n.(b.addr) > 1#}
  • N. Shimizu <chikoski@gmail.com> 2011/08/18pred show(b: Book){# ##(b.addr) > 1# ##Name.(b.addr) > 1#}
  • N. Shimizu <chikoski@gmail.com> 2011/08/18pred show(b: Book){# ##(b.addr) > 1# ##Name.(b.addr) > 1#}
  • N. Shimizu <chikoski@gmail.com> 2011/08/18
  • N. Shimizu <chikoski@gmail.com> 2011/08/182.2
pred add (b, b : Book , n: Name, a:Addr){# #b.addr = b.addr + n -> a#}
  • N. Shimizu <chikoski@gmail.com> 2011/08/18pred showAdd(b, b: Book, n:Name, a:Addr){# #add [b, b, n, a]# ##Name.(b.addr) > 1#}
  • N. Shimizu <chikoski@gmail.com> 2011/08/18run showAdd for 3 but 2 Book
  • N. Shimizu <chikoski@gmail.com> 2011/08/18 2 Bookrun showAdd for 3 but 2 Book
  • N. Shimizu <chikoski@gmail.com> 2011/08/18
  • N. Shimizu <chikoski@gmail.com> 2011/08/18pred del(b, b: Book, n:Name){# #b.addr = b.addr - n -> Addr#}
  • N. Shimizu <chikoski@gmail.com> 2011/08/18fun lookup(b: Book, n:Name): set Addr{# #n.(b.addr)#}
  • N. Shimizu <chikoski@gmail.com> 2011/08/18assert delUndoesAdd{# #all b, b, b: Book, n:Name, a:Addr |# # #no n.(b.addr) and # # #add [b, b, n, a] and # # #del[b, b, n]# # #implies b.addr = b.addr#}#
  • N. Shimizu <chikoski@gmail.com> 2011/08/18 (Assertion)• •  #   #   Java assert# p  assert(args.length > 0)# p  assert(a != null)#
  • N. Shimizu <chikoski@gmail.com> 2011/08/18assert delUndoesAdd{# #all b, b, b: Book, n:Name, a:Addr |# # #no n.(b.addr) and # # #add [b, b, n, a] and # # #del[b’, b, n]# # #implies b.addr = b.addr#}#
  • N. Shimizu <chikoski@gmail.com> 2011/08/18check delUndoesAdd for 3
  • N. Shimizu <chikoski@gmail.com> 2011/08/18
  • N. Shimizu <chikoski@gmail.com> 2011/08/18assert delUndoesAdd{# #all b, b, b: Book, n:Name, a:Addr |# # #add [b, b, n, a] and del[b, b, n]# # #implies b.addr = b.addr#}
  • N. Shimizu <chikoski@gmail.com> 2011/08/18
  • N. Shimizu <chikoski@gmail.com> 2011/08/18all x: e | F• e x F #• all n:Name | #n.(b.addr) > 1#  Name n #  #n.(b.addr) > 1 #
  • N. Shimizu <chikoski@gmail.com> 2011/08/18書式 意味 some e e はタプルをいくつか持つ no e e はタプルを持たない lone e e はタプルを多くても1つ持つ one e e はタプルをちょうど1つ持つ
  • N. Shimizu <chikoski@gmail.com> 2011/08/18演算子 短縮形式 意味 not ! 否定 and && 連言 or || 選言 implies => 含意 iff <=> 両含意
  • N. Shimizu <chikoski@gmail.com> 2011/08/182.3:•  #• Java
  • N. Shimizu <chikoski@gmail.com> 2011/08/18module tour/addressBook2##abstract sig Target {}#sig Addr extends Target {}#abstract sig Name extends Target{}#sig Alias, Group extends Name {}#sig Book { addr: Name -> Target}
  • N. Shimizu <chikoski@gmail.com> 2011/08/18
  • N. Shimizu <chikoski@gmail.com> 2011/08/18•  ‘Execute’ “Show MetaModel”#•  M
  • N. Shimizu <chikoski@gmail.com> 2011/08/18fact{# #all b:Book | # # #no n:Name | n in n.^(b.addr)#}
  • N. Shimizu <chikoski@gmail.com> 2011/08/18 
sib Book{addr: Name -> Target} {# #no n:Name | n in n.^addr#}
  • N. Shimizu <chikoski@gmail.com> 2011/08/18in :• p in q p q #• n in n.^(b.addr) #  n n^(b.addr) #  n n addr #
  • N. Shimizu <chikoski@gmail.com> 2011/08/18^:•  r #• ^r = r + r.r + r.r.r + r.r.r.r + …
  • N. Shimizu <chikoski@gmail.com> 2011/08/18Alaispred show(b: Book) { some Alias.(b.addr)}
  • N. Shimizu <chikoski@gmail.com> 2011/08/18
  • N. Shimizu <chikoski@gmail.com> 2011/08/18 Addr Groupsig Book { addr: Name -> Target}{# #all a: Alias | lone a.addr#}
  • N. Shimizu <chikoski@gmail.com> 2011/08/18
  • N. Shimizu <chikoski@gmail.com> 2011/08/18•  #•  #•  #