Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
why3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
125
Issues
125
List
Boards
Labels
Service Desk
Milestones
Merge Requests
17
Merge Requests
17
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Why3
why3
Commits
952cc543
Commit
952cc543
authored
Dec 14, 2010
by
MARCHE Claude
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new example: scottish club
parent
b402afbd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
3 deletions
+68
-3
.gitignore
.gitignore
+10
-3
examples/scottish-private-club.why
examples/scottish-private-club.why
+48
-0
tests/test-claude.why
tests/test-claude.why
+10
-0
No files found.
.gitignore
View file @
952cc543
*~
*.bak
*.o
*.svn
.*.swp
...
...
@@ -45,13 +46,14 @@ why.conf
/bin/why3-cpulimit
/bin/whyconfig.byte
/bin/whyconfig.opt
/bin/why
db
.byte
/bin/why
db
.opt
/bin/why
bench
.byte
/bin/why
bench
.opt
/bin/whytptp.byte
/bin/whytptp.opt
# /doc/
/doc/version.tex
/doc/ocamldoc.sty
/doc/*whizzy*
/doc/manual.wdvi
/doc/manual.raux
...
...
@@ -63,6 +65,7 @@ why.conf
/doc/manual.ind
/doc/manual.ilg
/doc/manual.idx
/doc/manual.rel
/doc/*.haux
/doc/*.pdf
/doc/manual.html
...
...
@@ -160,4 +163,8 @@ why.conf
/src/util/rc.ml
# /tests/
/tests/*.db
/tests/test-claude/
# /examples/
/examples/programs/my_cosine/*.gappa
/examples/scottish-private-club/
\ No newline at end of file
examples/scottish-private-club.why
0 → 100644
View file @
952cc543
(*
The classical example of the Scottish private club puzzle
The club follows six rules:
- every non-scottish members wear red socks
- every member wears a kilt or doesn't wear socks
- the married members don't go out on sunday
- a member goes out on sunday if and only if he is scottish
- every member who wears a kilt is scottish and married
- every scottish member wears a kilt
Problem: prove that there is nobody in this club !
*)
theory ScottishClubProblem "the Scottish private club puzzle"
type member
logic is_scottish member
logic wears_red_socks member
logic wears_kilt member
logic is_married member
logic goes_out_on_sunday member
axiom R1: forall m:member. not (is_scottish m) -> wears_red_socks m
axiom R2: forall m:member. wears_kilt m or not (wears_red_socks m)
axiom R3: forall m:member. is_married m -> not (goes_out_on_sunday m)
axiom R4: forall m:member. goes_out_on_sunday m <-> is_scottish m
axiom R5: forall m:member. wears_kilt m -> is_scottish m and is_married m
axiom R6: forall m:member. is_scottish m -> wears_kilt m
goal ThereIsNobodyInTheClub: false
end
tests/test-claude.why
View file @
952cc543
theory TestProp
logic a
logic b
goal Test1: a and b -> a
end
theory TestInt
use import int.Int
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment