Commit 9c4c6599 by MARCHE Claude

### Add timelimit in database. Fix the Einstein puzzle

parent 1501f43a
 ... ... @@ -48,81 +48,83 @@ theory Einstein "Einstein's problem" leftof h1 h2 or rightof h1 h2 end theory EinsteinHints "Hints" theory EinsteinClues "Clues" use import Einstein (* The Englishman lives in a red house *) axiom Hint1: Color.of (Owner.to_ Englishman) = Red axiom Clue1: Color.of (Owner.to_ Englishman) = Red (* The Swede has dogs *) axiom Hint2: Pet.of Swede = Dogs axiom Clue2: Pet.of Swede = Dogs (* The Dane drinks tea *) axiom Hint3: Drink.of Dane = Tea axiom Clue3: Drink.of Dane = Tea (* The green house is on the left of the white one *) axiom Hint4: leftof (Color.to_ Green) (Color.to_ White) axiom Clue4: leftof (Color.to_ Green) (Color.to_ White) (* The green house's owner drinks coffee *) axiom Hint5: Drink.of (Owner.of (Color.to_ Green)) = Coffee axiom Clue5: Drink.of (Owner.of (Color.to_ Green)) = Coffee (* The person who smokes Pall Mall has birds *) axiom Hint6: Pet.of (Cigar.to_ PallMall) = Birds axiom Clue6: Pet.of (Cigar.to_ PallMall) = Birds (* The yellow house's owner smokes Dunhill *) axiom Hint7: Cigar.of (Owner.of (Color.to_ Yellow)) = Dunhill axiom Clue7: Cigar.of (Owner.of (Color.to_ Yellow)) = Dunhill (* In the house in the center lives someone who drinks milk *) axiom Hint8: Drink.of (Owner.of H3) = Milk axiom Clue8: Drink.of (Owner.of H3) = Milk (* The Norwegian lives in the first house *) axiom Hint9: Owner.of H1 = Norwegian axiom Clue9: Owner.of H1 = Norwegian (* The man who smokes Blends lives next to the one who has cats *) axiom Hint10: neighbour axiom Clue10: neighbour (Owner.to_ (Cigar.to_ Blend)) (Owner.to_ (Pet.to_ Cats)) (* The man who owns a horse lives next to the one who smokes Dunhills *) axiom Hint11: neighbour axiom Clue11: neighbour (Owner.to_ (Pet.to_ Horse)) (Owner.to_ (Cigar.to_ Dunhill)) (* The man who smokes Blue Masters drinks beer *) axiom Hint12: axiom Clue12: Drink.of (Cigar.to_ BlueMaster) = Beer (* The German smokes Prince *) axiom Hint13: axiom Clue13: Cigar.of German = Prince (* The Norwegian lives next to the blue house *) axiom Hint14: axiom Clue14: neighbour (Owner.to_ Norwegian) (Color.to_ Blue) (* The man who smokes Blends has a neighbour who drinks water *) axiom Hint15: axiom Clue15: neighbour (Owner.to_ (Cigar.to_ Blend)) (Owner.to_ (Drink.to_ Water)) end theory Goals "Goals about Einstein's problem" use import Einstein use import EinsteinHints (* lemma First_House_Not_White: Color.of H1 <> White *) (* lemma Last_House_Not_Green: Color.of H5 <> Green *) (* lemma Blue_not_Red: Blue <> Red *) (* lemma Englishman_not_H2: Owner.to_ Englishman <> H2 *) (* lemma Englishman_not_H1: Owner.to_ Englishman <> H1 *) (* lemma Second_House_Blue: Color.of H2 = Blue *) (* lemma Green_H4 : Color.of H4 = Green *) (* lemma White_H5 : Color.of H5 = White *) (* lemma Red_H3 : Color.of H3 = Red *) (* lemma Yellow_H1 : Color.of H1 = Yellow *) use import EinsteinClues (* lemma First_House_Not_White: Color.of H1 <> White lemma Last_House_Not_Green: Color.of H5 <> Green lemma Blue_not_Red: Blue <> Red lemma Englishman_not_H2: Owner.to_ Englishman <> H2 lemma Englishman_not_H1: Owner.to_ Englishman <> H1 lemma Second_House_Blue: Color.of H2 = Blue lemma Green_H4 : Color.of H4 = Green lemma White_H5 : Color.of H5 = White lemma Red_H3 : Color.of H3 = Red lemma Yellow_H1 : Color.of H1 = Yellow *) goal G1: Pet.to_ Fish = German goal G2: Pet.to_ Cats = Swede goal Wrong: Pet.to_ Cats = Swede goal G2: Pet.to_ Cats = Norwegian end ... ...
 ... ... @@ -6,29 +6,31 @@ ... ...
 ... ... @@ -578,6 +578,7 @@ let prover_on_selected_goals pr = let a = get_any row in M.run_prover ~context_unproved_goals_only:!context_unproved_goals_only ~timelimit:gconfig.time_limit pr a) goals_view#selection#get_selected_rows ... ...