Merge conflicts from master fixed

This commit is contained in:
Paul Chaignon
2014-06-19 18:45:56 +02:00
10 changed files with 911 additions and 18 deletions

View File

@@ -0,0 +1,46 @@
theory HelloWorld
imports Main
begin
section{*Playing around with Isabelle*}
text{* creating a lemma with the name hello_world*}
lemma hello_world: "True" by simp
(*inspecting it*)
thm hello_world
text{* defining a string constant HelloWorld *}
definition HelloWorld :: "string" where
"HelloWorld \<equiv> ''Hello World!''"
(*reversing HelloWorld twice yilds HelloWorld again*)
theorem "rev (rev HelloWorld) = HelloWorld"
by (fact List.rev_rev_ident)
text{*now we delete the already proven List.rev_rev_ident lema and show it by hand*}
declare List.rev_rev_ident[simp del]
hide_fact List.rev_rev_ident
(*It's trivial since we can just 'execute' it*)
corollary "rev (rev HelloWorld) = HelloWorld"
apply(simp add: HelloWorld_def)
done
text{*does it hold in general?*}
theorem rev_rev_ident:"rev (rev l) = l"
proof(induction l)
case Nil thus ?case by simp
next
case (Cons l ls)
assume IH: "rev (rev ls) = ls"
have "rev (l#ls) = (rev ls) @ [l]" by simp
hence "rev (rev (l#ls)) = rev ((rev ls) @ [l])" by simp
also have "\<dots> = [l] @ rev (rev ls)" by simp
finally show "rev (rev (l#ls)) = l#ls" using IH by simp
qed
corollary "\<forall>(l::string). rev (rev l) = l" by(fastforce intro: rev_rev_ident)
end

21
samples/XML/sample.nuspec Normal file
View File

@@ -0,0 +1,21 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Sample</id>
<title>Sample</title>
<version>0.101.0</version>
<authors>Hugh Bot</authors>
<owners>Hugh Bot</owners>
<summary>A package of nuget</summary>
<description>
It just works
</description>
<projectUrl>http://hubot.github.com</projectUrl>
<copyright/>
<licenseUrl>https://github.com/github/hubot/LICENSEmd</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
</metadata>
<files>
<file src="tools\**" target="tools"/>
</files>
</package>

View File

@@ -0,0 +1,22 @@
#tag Class
Protected Class App
Inherits Application
#tag Constant, Name = kEditClear, Type = String, Dynamic = False, Default = \"&Delete", Scope = Public
#Tag Instance, Platform = Windows, Language = Default, Definition = \"&Delete"
#Tag Instance, Platform = Linux, Language = Default, Definition = \"&Delete"
#tag EndConstant
#tag Constant, Name = kFileQuit, Type = String, Dynamic = False, Default = \"&Quit", Scope = Public
#Tag Instance, Platform = Windows, Language = Default, Definition = \"E&xit"
#tag EndConstant
#tag Constant, Name = kFileQuitShortcut, Type = String, Dynamic = False, Default = \"", Scope = Public
#Tag Instance, Platform = Mac OS, Language = Default, Definition = \"Cmd+Q"
#Tag Instance, Platform = Linux, Language = Default, Definition = \"Ctrl+Q"
#tag EndConstant
#tag ViewBehavior
#tag EndViewBehavior
End Class
#tag EndClass

View File

@@ -0,0 +1,23 @@
#tag Report
Begin Report BillingReport
Compatibility = ""
Units = 0
Width = 8.5
Begin PageHeader
Type = 1
Height = 1.0
End
Begin Body
Type = 3
Height = 2.0
End
Begin PageFooter
Type = 5
Height = 1.0
End
End
#tag EndReport
#tag ReportCode
#tag EndReportCode

View File

@@ -0,0 +1,112 @@
#tag Menu
Begin Menu MainMenuBar
Begin MenuItem FileMenu
SpecialMenu = 0
Text = "&File"
Index = -2147483648
AutoEnable = True
Visible = True
Begin QuitMenuItem FileQuit
SpecialMenu = 0
Text = "#App.kFileQuit"
Index = -2147483648
ShortcutKey = "#App.kFileQuitShortcut"
Shortcut = "#App.kFileQuitShortcut"
AutoEnable = True
Visible = True
End
End
Begin MenuItem EditMenu
SpecialMenu = 0
Text = "&Edit"
Index = -2147483648
AutoEnable = True
Visible = True
Begin MenuItem EditUndo
SpecialMenu = 0
Text = "&Undo"
Index = -2147483648
ShortcutKey = "Z"
Shortcut = "Cmd+Z"
MenuModifier = True
AutoEnable = True
Visible = True
End
Begin MenuItem EditSeparator1
SpecialMenu = 0
Text = "-"
Index = -2147483648
AutoEnable = True
Visible = True
End
Begin MenuItem EditCut
SpecialMenu = 0
Text = "Cu&t"
Index = -2147483648
ShortcutKey = "X"
Shortcut = "Cmd+X"
MenuModifier = True
AutoEnable = True
Visible = True
End
Begin MenuItem EditCopy
SpecialMenu = 0
Text = "&Copy"
Index = -2147483648
ShortcutKey = "C"
Shortcut = "Cmd+C"
MenuModifier = True
AutoEnable = True
Visible = True
End
Begin MenuItem EditPaste
SpecialMenu = 0
Text = "&Paste"
Index = -2147483648
ShortcutKey = "V"
Shortcut = "Cmd+V"
MenuModifier = True
AutoEnable = True
Visible = True
End
Begin MenuItem EditClear
SpecialMenu = 0
Text = "#App.kEditClear"
Index = -2147483648
AutoEnable = True
Visible = True
End
Begin MenuItem EditSeparator2
SpecialMenu = 0
Text = "-"
Index = -2147483648
AutoEnable = True
Visible = True
End
Begin MenuItem EditSelectAll
SpecialMenu = 0
Text = "Select &All"
Index = -2147483648
ShortcutKey = "A"
Shortcut = "Cmd+A"
MenuModifier = True
AutoEnable = True
Visible = True
End
Begin MenuItem UntitledSeparator
SpecialMenu = 0
Text = "-"
Index = -2147483648
AutoEnable = True
Visible = True
End
Begin AppleMenuItem AboutItem
SpecialMenu = 0
Text = "About This App..."
Index = -2147483648
AutoEnable = True
Visible = True
End
End
End
#tag EndMenu

View File

@@ -0,0 +1,14 @@
#tag Toolbar
Begin Toolbar MyToolbar
Begin ToolButton FirstItem
Caption = "First Item"
HelpTag = ""
Style = 0
End
Begin ToolButton SecondItem
Caption = "Second Item"
HelpTag = ""
Style = 0
End
End
#tag EndToolbar

View File

@@ -0,0 +1,304 @@
#tag Window
Begin Window Window1
BackColor = &cFFFFFF00
Backdrop = 0
CloseButton = True
Compatibility = ""
Composite = False
Frame = 0
FullScreen = False
FullScreenButton= False
HasBackColor = False
Height = 400
ImplicitInstance= True
LiveResize = True
MacProcID = 0
MaxHeight = 32000
MaximizeButton = True
MaxWidth = 32000
MenuBar = 1153981589
MenuBarVisible = True
MinHeight = 64
MinimizeButton = True
MinWidth = 64
Placement = 0
Resizeable = True
Title = "Sample App"
Visible = True
Width = 600
Begin PushButton HelloWorldButton
AutoDeactivate = True
Bold = False
ButtonStyle = "0"
Cancel = False
Caption = "Push Me"
Default = True
Enabled = True
Height = 20
HelpTag = ""
Index = -2147483648
InitialParent = ""
Italic = False
Left = 260
LockBottom = False
LockedInPosition= False
LockLeft = True
LockRight = False
LockTop = True
Scope = 0
TabIndex = 0
TabPanelIndex = 0
TabStop = True
TextFont = "System"
TextSize = 0.0
TextUnit = 0
Top = 32
Underline = False
Visible = True
Width = 80
End
End
#tag EndWindow
#tag WindowCode
#tag EndWindowCode
#tag Events HelloWorldButton
#tag Event
Sub Action()
Dim total As Integer
For i As Integer = 0 To 10
total = total + i
Next
MsgBox "Hello World! " + Str(total)
End Sub
#tag EndEvent
#tag EndEvents
#tag ViewBehavior
#tag ViewProperty
Name="BackColor"
Visible=true
Group="Appearance"
InitialValue="&hFFFFFF"
Type="Color"
#tag EndViewProperty
#tag ViewProperty
Name="Backdrop"
Visible=true
Group="Appearance"
Type="Picture"
EditorType="Picture"
#tag EndViewProperty
#tag ViewProperty
Name="CloseButton"
Visible=true
Group="Appearance"
InitialValue="True"
Type="Boolean"
EditorType="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="Composite"
Visible=true
Group="Appearance"
InitialValue="False"
Type="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="Frame"
Visible=true
Group="Appearance"
InitialValue="0"
Type="Integer"
EditorType="Enum"
#tag EnumValues
"0 - Document"
"1 - Movable Modal"
"2 - Modal Dialog"
"3 - Floating Window"
"4 - Plain Box"
"5 - Shadowed Box"
"6 - Rounded Window"
"7 - Global Floating Window"
"8 - Sheet Window"
"9 - Metal Window"
"10 - Drawer Window"
"11 - Modeless Dialog"
#tag EndEnumValues
#tag EndViewProperty
#tag ViewProperty
Name="FullScreen"
Group="Appearance"
InitialValue="False"
Type="Boolean"
EditorType="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="FullScreenButton"
Visible=true
Group="Appearance"
InitialValue="False"
Type="Boolean"
EditorType="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="HasBackColor"
Visible=true
Group="Appearance"
InitialValue="False"
Type="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="Height"
Visible=true
Group="Position"
InitialValue="400"
Type="Integer"
#tag EndViewProperty
#tag ViewProperty
Name="ImplicitInstance"
Visible=true
Group="Appearance"
InitialValue="True"
Type="Boolean"
EditorType="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="Interfaces"
Visible=true
Group="ID"
Type="String"
#tag EndViewProperty
#tag ViewProperty
Name="LiveResize"
Visible=true
Group="Appearance"
InitialValue="True"
Type="Boolean"
EditorType="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="MacProcID"
Visible=true
Group="Appearance"
InitialValue="0"
Type="Integer"
#tag EndViewProperty
#tag ViewProperty
Name="MaxHeight"
Visible=true
Group="Position"
InitialValue="32000"
Type="Integer"
#tag EndViewProperty
#tag ViewProperty
Name="MaximizeButton"
Visible=true
Group="Appearance"
InitialValue="True"
Type="Boolean"
EditorType="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="MaxWidth"
Visible=true
Group="Position"
InitialValue="32000"
Type="Integer"
#tag EndViewProperty
#tag ViewProperty
Name="MenuBar"
Visible=true
Group="Appearance"
Type="MenuBar"
EditorType="MenuBar"
#tag EndViewProperty
#tag ViewProperty
Name="MenuBarVisible"
Group="Appearance"
InitialValue="True"
Type="Boolean"
EditorType="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="MinHeight"
Visible=true
Group="Position"
InitialValue="64"
Type="Integer"
#tag EndViewProperty
#tag ViewProperty
Name="MinimizeButton"
Visible=true
Group="Appearance"
InitialValue="True"
Type="Boolean"
EditorType="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="MinWidth"
Visible=true
Group="Position"
InitialValue="64"
Type="Integer"
#tag EndViewProperty
#tag ViewProperty
Name="Name"
Visible=true
Group="ID"
Type="String"
#tag EndViewProperty
#tag ViewProperty
Name="Placement"
Visible=true
Group="Position"
InitialValue="0"
Type="Integer"
EditorType="Enum"
#tag EnumValues
"0 - Default"
"1 - Parent Window"
"2 - Main Screen"
"3 - Parent Window Screen"
"4 - Stagger"
#tag EndEnumValues
#tag EndViewProperty
#tag ViewProperty
Name="Resizeable"
Visible=true
Group="Appearance"
InitialValue="True"
Type="Boolean"
EditorType="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="Super"
Visible=true
Group="ID"
Type="String"
#tag EndViewProperty
#tag ViewProperty
Name="Title"
Visible=true
Group="Appearance"
InitialValue="Untitled"
Type="String"
#tag EndViewProperty
#tag ViewProperty
Name="Visible"
Visible=true
Group="Appearance"
InitialValue="True"
Type="Boolean"
EditorType="Boolean"
#tag EndViewProperty
#tag ViewProperty
Name="Width"
Visible=true
Group="Position"
InitialValue="600"
Type="Integer"
#tag EndViewProperty
#tag EndViewBehavior

View File

@@ -0,0 +1,17 @@
Dim dbFile As FolderItem
Dim db As New SQLiteDatabase
dbFile = GetFolderItem("Employees.sqlite")
db.DatabaseFile = dbFile
If db.Connect Then
db.SQLExecute("BEGIN TRANSACTION")
db.SQLExecute ("INSERT INTO Employees (Name,Job,YearJoined) VALUES "_
+"('Dr.Strangelove','Advisor',1962)")
If db.Error then
MsgBox("Error: " + db.ErrorMessage)
db.Rollback
Else
db.Commit
End If
Else
MsgBox("The database couldn't be opened. Error: " + db.ErrorMessage)
End If