Skip to content

Commit

Permalink
Fix the miniML type soundness proof for =
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Owens authored and Scott Owens committed Feb 28, 2012
1 parent 4cf17fb commit eefe62f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/miniML/MiniMLScript.sml
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ val _ = Define `
(Opapp, Tfn t2' t3', _) => (t2 = t2') /\ (t3 = t3')
| (Opn _, Tnum, Tnum) => (t3 = Tnum)
| (Opb _, Tnum, Tnum) => (t3 = Tbool)
| (Equality, t1, t2) => (t1 = t2)
| (Equality, t1, t2) => (t1 = t2) /\ (t3 = Tbool)
| _ => F
))`;

Expand Down
2 changes: 1 addition & 1 deletion examples/miniML/miniML.lem
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ let type_op op t1 t2 t3 =
| (Opapp, Tfn t2' t3', _) -> (t2 = t2') && (t3 = t3')
| (Opn _, Tnum, Tnum) -> (t3 = Tnum)
| (Opb _, Tnum, Tnum) -> (t3 = Tbool)
| (Equality, t1, t2) -> (t1 = t2)
| (Equality, t1, t2) -> (t1 = t2) && (t3 = Tbool)
| _ -> false
end

Expand Down
11 changes: 10 additions & 1 deletion examples/miniML/typeSoundScript.sml
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,8 @@ val type_op_cases = Q.prove (
type_op op t1 t2 t3 =
((∃op'. op = Opn op') ∧ (t1 = Tnum) ∧ (t2 = Tnum) ∧ (t3 = Tnum)) ∨
((∃op'. op = Opb op') ∧ (t1 = Tnum) ∧ (t2 = Tnum) ∧ (t3 = Tbool)) ∨
((op = Opapp) ∧ (t1 = Tfn t2 t3))`,
((op = Opapp) ∧ (t1 = Tfn t2 t3)) ∨
((op = Equality) ∧ (t1 = t2) ∧ (t3 = Tbool))`,
rw [type_op_def] >>
every_case_tac >>
fs [] >>
Expand Down Expand Up @@ -731,6 +732,14 @@ rw [] >|
fs [type_op_cases] >>
rw [] >>
metis_tac [],
every_case_tac >>
fs [] >>
rw [type_e_val] >>
fs [hd (CONJUNCTS type_v_cases)] >>
rw [] >>
fs [type_op_cases] >>
rw [] >>
metis_tac [],
every_case_tac >>
fs [] >>
rw [type_e_val] >|
Expand Down

0 comments on commit eefe62f

Please sign in to comment.