src/FOL/fologic.ML
author wenzelm
Sun, 19 Sep 2021 21:37:14 +0200
changeset 74319 54b2e5f771da
parent 74293 54279cfcf037
child 74320 dd04da556d1a
permissions -rw-r--r--
clarified signature -- prefer antiquotations (with subtle change of exception content);
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4349
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents:
diff changeset
     1
(*  Title:      FOL/fologic.ML
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents:
diff changeset
     2
    Author:     Lawrence C Paulson
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents:
diff changeset
     3
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents:
diff changeset
     4
Abstract syntax operations for FOL.
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents:
diff changeset
     5
*)
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents:
diff changeset
     6
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents:
diff changeset
     7
signature FOLOGIC =
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents:
diff changeset
     8
sig
32449
696d64ed85da eliminated hard tabs;
wenzelm
parents: 31974
diff changeset
     9
  val mk_Trueprop: term -> term
696d64ed85da eliminated hard tabs;
wenzelm
parents: 31974
diff changeset
    10
  val dest_Trueprop: term -> term
696d64ed85da eliminated hard tabs;
wenzelm
parents: 31974
diff changeset
    11
  val mk_conj: term * term -> term
696d64ed85da eliminated hard tabs;
wenzelm
parents: 31974
diff changeset
    12
  val mk_disj: term * term -> term
696d64ed85da eliminated hard tabs;
wenzelm
parents: 31974
diff changeset
    13
  val mk_imp: term * term -> term
696d64ed85da eliminated hard tabs;
wenzelm
parents: 31974
diff changeset
    14
  val dest_imp: term -> term * term
696d64ed85da eliminated hard tabs;
wenzelm
parents: 31974
diff changeset
    15
  val dest_conj: term -> term list
696d64ed85da eliminated hard tabs;
wenzelm
parents: 31974
diff changeset
    16
  val mk_iff: term * term -> term
696d64ed85da eliminated hard tabs;
wenzelm
parents: 31974
diff changeset
    17
  val dest_iff: term -> term * term
696d64ed85da eliminated hard tabs;
wenzelm
parents: 31974
diff changeset
    18
  val all_const: typ -> term
696d64ed85da eliminated hard tabs;
wenzelm
parents: 31974
diff changeset
    19
  val mk_all: term * term -> term
696d64ed85da eliminated hard tabs;
wenzelm
parents: 31974
diff changeset
    20
  val exists_const: typ -> term
696d64ed85da eliminated hard tabs;
wenzelm
parents: 31974
diff changeset
    21
  val mk_exists: term * term -> term
696d64ed85da eliminated hard tabs;
wenzelm
parents: 31974
diff changeset
    22
  val eq_const: typ -> term
696d64ed85da eliminated hard tabs;
wenzelm
parents: 31974
diff changeset
    23
  val mk_eq: term * term -> term
696d64ed85da eliminated hard tabs;
wenzelm
parents: 31974
diff changeset
    24
  val dest_eq: term -> term * term
4349
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents:
diff changeset
    25
end;
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents:
diff changeset
    26
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents:
diff changeset
    27
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents:
diff changeset
    28
structure FOLogic: FOLOGIC =
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents:
diff changeset
    29
struct
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents:
diff changeset
    30
74319
54b2e5f771da clarified signature -- prefer antiquotations (with subtle change of exception content);
wenzelm
parents: 74293
diff changeset
    31
fun mk_Trueprop P = \<^Const>\<open>Trueprop for P\<close>;
4349
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents:
diff changeset
    32
74319
54b2e5f771da clarified signature -- prefer antiquotations (with subtle change of exception content);
wenzelm
parents: 74293
diff changeset
    33
val dest_Trueprop = \<^Const_fn>\<open>Trueprop for P => P\<close>;
4349
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents:
diff changeset
    34
74319
54b2e5f771da clarified signature -- prefer antiquotations (with subtle change of exception content);
wenzelm
parents: 74293
diff changeset
    35
fun mk_conj (t1, t2) = \<^Const>\<open>conj for t1 t2\<close>
54b2e5f771da clarified signature -- prefer antiquotations (with subtle change of exception content);
wenzelm
parents: 74293
diff changeset
    36
and mk_disj (t1, t2) = \<^Const>\<open>disj for t1 t2\<close>
54b2e5f771da clarified signature -- prefer antiquotations (with subtle change of exception content);
wenzelm
parents: 74293
diff changeset
    37
and mk_imp (t1, t2) = \<^Const>\<open>imp for t1 t2\<close>
54b2e5f771da clarified signature -- prefer antiquotations (with subtle change of exception content);
wenzelm
parents: 74293
diff changeset
    38
and mk_iff (t1, t2) = \<^Const>\<open>iff for t1 t2\<close>;
4349
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents:
diff changeset
    39
74319
54b2e5f771da clarified signature -- prefer antiquotations (with subtle change of exception content);
wenzelm
parents: 74293
diff changeset
    40
val dest_imp = \<^Const_fn>\<open>imp for A B => \<open>(A, B)\<close>\<close>;
4466
305390f23734 Better equality handling in Blast_tac, usingd a new variant of hyp_subst_tac
paulson
parents: 4349
diff changeset
    41
74293
54279cfcf037 more antiquotations;
wenzelm
parents: 69593
diff changeset
    42
fun dest_conj \<^Const_>\<open>conj for t t'\<close> = t :: dest_conj t'
11668
548ba68385a3 added dest_conj, dest_concls;
wenzelm
parents: 10384
diff changeset
    43
  | dest_conj t = [t];
548ba68385a3 added dest_conj, dest_concls;
wenzelm
parents: 10384
diff changeset
    44
74319
54b2e5f771da clarified signature -- prefer antiquotations (with subtle change of exception content);
wenzelm
parents: 74293
diff changeset
    45
val dest_iff = \<^Const_fn>\<open>iff for A B => \<open>(A, B)\<close>\<close>;
9543
ce61d1c1a509 new abstract syntax operations, used in ZF
paulson
parents: 9473
diff changeset
    46
74293
54279cfcf037 more antiquotations;
wenzelm
parents: 69593
diff changeset
    47
fun eq_const T = \<^Const>\<open>eq T\<close>;
4349
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents:
diff changeset
    48
fun mk_eq (t, u) = eq_const (fastype_of t) $ t $ u;
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents:
diff changeset
    49
74319
54b2e5f771da clarified signature -- prefer antiquotations (with subtle change of exception content);
wenzelm
parents: 74293
diff changeset
    50
val dest_eq = \<^Const_fn>\<open>eq _ for lhs rhs => \<open>(lhs, rhs)\<close>\<close>;
6140
af32e2c3f77a tidied; added dest_eq
paulson
parents: 4466
diff changeset
    51
74293
54279cfcf037 more antiquotations;
wenzelm
parents: 69593
diff changeset
    52
fun all_const T = \<^Const>\<open>All T\<close>;
44241
7943b69f0188 modernized signature of Term.absfree/absdummy;
wenzelm
parents: 41310
diff changeset
    53
fun mk_all (Free (x, T), P) = all_const T $ absfree (x, T) P;
4349
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents:
diff changeset
    54
74293
54279cfcf037 more antiquotations;
wenzelm
parents: 69593
diff changeset
    55
fun exists_const T = \<^Const>\<open>Ex T\<close>;
44241
7943b69f0188 modernized signature of Term.absfree/absdummy;
wenzelm
parents: 41310
diff changeset
    56
fun mk_exists (Free (x, T), P) = exists_const T $ absfree (x, T) P;
4349
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents:
diff changeset
    57
50403e5a44c0 Instantiated the one-point-rule quantifier simpprocs for FOL
paulson
parents:
diff changeset
    58
end;