Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix induction command (issue #1141) #1142

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/handle/tactic.ml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ let ind_data : popt -> Env.t -> term -> Sign.ind_data = fun pos env a ->
begin
try
let ind = SymMap.find s !(sign.sign_ind) in
let _, ts = List.cut ts ind.ind_nb_params (*remove parameters*) in
let ctxt = Env.to_ctxt env in
if LibTerm.distinct_vars ctxt (Array.of_list ts) = None
then fatal pos "%a is not applied to distinct variables." sym s
Expand Down
8 changes: 8 additions & 0 deletions tests/OK/1141.lp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require open tests.OK.Set tests.OK.Prop tests.OK.Nat tests.OK.List;

symbol sample_1 (list : 𝕃 nat) : π ⊤ ≔
begin
induction
{ apply ⊤ᵢ }
{ assume x l ih; apply ih }
end;
2 changes: 1 addition & 1 deletion tests/OK/922.lp
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ with is0 (_ +1) ↪ false;

opaque symbol s≠0 [n] : π (n +1 ≠ 0) ≔
begin
assume n h; refine ind_eq h (λ n, istrue(is0 n)) top
assume n h; refine ind_eq h (λ n, istrue(is0 n)) ⊤ᵢ
end;
2 changes: 1 addition & 1 deletion tests/OK/Prop.lp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ builtin "P" ≔ π;

constant symbol ⊤ : Prop; // \top

constant symbol top : π ⊤;
constant symbol ⊤ᵢ : π ⊤;

// false

Expand Down
2 changes: 1 addition & 1 deletion tests/export_raw_dk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ do
# proofs
why3*|tutorial|try|tautologies|rewrite*|remove|natproofs|have|generalize|foo|comment_in_qid|apply|anonymous|admit);;
# "open"
triangular|power-fact|postfix|perf_rw_*|not-eager|nonLeftLinear2|natural|Nat|lpparse2|logic|List|FOL|Eq|doc|Bool|arity_var|arity_diff|922|262_pair_ex_2|215);;
triangular|power-fact|postfix|perf_rw_*|not-eager|nonLeftLinear2|natural|Nat|lpparse2|logic|List|FOL|Eq|doc|Bool|arity_var|arity_diff|922|262_pair_ex_2|215|1141);;
# "inductive"
strictly_positive_*|inductive|989|904|830|341);;
# underscore in query
Expand Down
Loading