TFL/usyntax.sig
author oheimb
Wed, 27 Nov 1996 20:36:33 +0100
changeset 2263 c741309167bf
parent 2112 3902e9af752f
child 3245 241838c01caf
permissions -rw-r--r--
moved split_tac
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2112
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
     1
signature USyntax_sig =
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
     2
sig
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
     3
  structure Utils : Utils_sig
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
     4
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
     5
  type Type
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
     6
  type Term
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
     7
  type Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
     8
  type 'a binding
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
     9
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    10
  datatype lambda = VAR   of {Name : string, Ty : Type}
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    11
                  | CONST of {Name : string, Ty : Type}
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    12
                  | COMB  of {Rator: Preterm, Rand : Preterm}
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    13
                  | LAMB  of {Bvar : Preterm, Body : Preterm}
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    14
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    15
  val alpha : Type
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    16
  val bool  : Type
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    17
  val mk_preterm : Term -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    18
  val drop_Trueprop : Preterm -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    19
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    20
  (* Types *)
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    21
  val type_vars  : Type -> Type list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    22
  val type_varsl : Type list -> Type list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    23
  val mk_type    : {Tyop: string, Args:Type list} -> Type
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    24
  val dest_type  : Type -> {Tyop : string, Args : Type list}
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    25
  val mk_vartype : string -> Type
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    26
  val is_vartype : Type -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    27
  val -->        : Type * Type -> Type
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    28
  val strip_type : Type -> Type list * Type
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    29
  val strip_prod_type : Type -> Type list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    30
  val match_type: Type -> Type -> Type binding list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    31
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    32
  (* Terms *)
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    33
  val free_vars  : Preterm -> Preterm list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    34
  val free_varsl : Preterm list -> Preterm list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    35
  val free_vars_lr : Preterm -> Preterm list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    36
  val all_vars   : Preterm -> Preterm list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    37
  val all_varsl  : Preterm list -> Preterm list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    38
  val variant    : Preterm list -> Preterm -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    39
  val type_of    : Preterm -> Type
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    40
  val type_vars_in_term : Preterm -> Type list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    41
  val dest_term  : Preterm -> lambda
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    42
  
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    43
  (* Prelogic *)
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    44
  val aconv     : Preterm -> Preterm -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    45
  val subst     : Preterm binding list -> Preterm -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    46
  val inst      : Type binding list -> Preterm -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    47
  val beta_conv : Preterm -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    48
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    49
  (* Construction routines *)
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    50
  val mk_prop   :Preterm -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    51
  val mk_var    :{Name : string, Ty : Type} -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    52
  val mk_const  :{Name : string, Ty : Type} -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    53
  val mk_comb   :{Rator : Preterm, Rand : Preterm} -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    54
  val mk_abs    :{Bvar  : Preterm, Body : Preterm} -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    55
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    56
  val mk_eq     :{lhs : Preterm, rhs : Preterm} -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    57
  val mk_imp    :{ant : Preterm, conseq :  Preterm} -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    58
  val mk_select :{Bvar : Preterm, Body : Preterm} -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    59
  val mk_forall :{Bvar : Preterm, Body : Preterm} -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    60
  val mk_exists :{Bvar : Preterm, Body : Preterm} -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    61
  val mk_conj   :{conj1 : Preterm, conj2 : Preterm} -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    62
  val mk_disj   :{disj1 : Preterm, disj2 : Preterm} -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    63
  val mk_pabs   :{varstruct : Preterm, body : Preterm} -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    64
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    65
  (* Destruction routines *)
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    66
  val dest_var  : Preterm -> {Name : string, Ty : Type}
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    67
  val dest_const: Preterm -> {Name : string, Ty : Type}
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    68
  val dest_comb : Preterm -> {Rator : Preterm, Rand : Preterm}
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    69
  val dest_abs  : Preterm -> {Bvar : Preterm, Body : Preterm}
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    70
  val dest_eq     : Preterm -> {lhs : Preterm, rhs : Preterm}
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    71
  val dest_imp    : Preterm -> {ant : Preterm, conseq : Preterm}
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    72
  val dest_select : Preterm -> {Bvar : Preterm, Body : Preterm}
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    73
  val dest_forall : Preterm -> {Bvar : Preterm, Body : Preterm}
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    74
  val dest_exists : Preterm -> {Bvar : Preterm, Body : Preterm}
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    75
  val dest_neg    : Preterm -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    76
  val dest_conj   : Preterm -> {conj1 : Preterm, conj2 : Preterm}
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    77
  val dest_disj   : Preterm -> {disj1 : Preterm, disj2 : Preterm}
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    78
  val dest_pair   : Preterm -> {fst : Preterm, snd : Preterm}
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    79
  val dest_pabs   : Preterm -> {varstruct : Preterm, body : Preterm}
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    80
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    81
  val lhs   : Preterm -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    82
  val rhs   : Preterm -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    83
  val rator : Preterm -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    84
  val rand  : Preterm -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    85
  val bvar  : Preterm -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    86
  val body  : Preterm -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    87
  
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    88
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    89
  (* Query routines *)
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    90
  val is_var  : Preterm -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    91
  val is_const: Preterm -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    92
  val is_comb : Preterm -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    93
  val is_abs  : Preterm -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    94
  val is_eq     : Preterm -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    95
  val is_imp    : Preterm -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    96
  val is_forall : Preterm -> bool 
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    97
  val is_exists : Preterm -> bool 
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    98
  val is_neg    : Preterm -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    99
  val is_conj   : Preterm -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   100
  val is_disj   : Preterm -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   101
  val is_pair   : Preterm -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   102
  val is_pabs   : Preterm -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   103
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   104
  (* Construction of a Preterm from a list of Preterms *)
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   105
  val list_mk_comb   : (Preterm * Preterm list) -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   106
  val list_mk_abs    : (Preterm list * Preterm) -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   107
  val list_mk_imp    : (Preterm list * Preterm) -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   108
  val list_mk_forall : (Preterm list * Preterm) -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   109
  val list_mk_exists : (Preterm list * Preterm) -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   110
  val list_mk_conj   : Preterm list -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   111
  val list_mk_disj   : Preterm list -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   112
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   113
  (* Destructing a Preterm to a list of Preterms *)
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   114
  val strip_comb     : Preterm -> (Preterm * Preterm list)
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   115
  val strip_abs      : Preterm -> (Preterm list * Preterm)
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   116
  val strip_imp      : Preterm -> (Preterm list * Preterm)
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   117
  val strip_forall   : Preterm -> (Preterm list * Preterm)
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   118
  val strip_exists   : Preterm -> (Preterm list * Preterm)
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   119
  val strip_conj     : Preterm -> Preterm list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   120
  val strip_disj     : Preterm -> Preterm list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   121
  val strip_pair     : Preterm -> Preterm list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   122
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   123
  (* Miscellaneous *)
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   124
  val mk_vstruct : Type -> Preterm list -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   125
  val gen_all    : Preterm -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   126
  val find_term  : (Preterm -> bool) -> Preterm -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   127
  val find_terms : (Preterm -> bool) -> Preterm -> Preterm list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   128
  val dest_relation : Preterm -> Preterm * Preterm * Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   129
  val is_WFR : Preterm -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   130
  val ARB : Type -> Preterm
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   131
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   132
  (* Prettyprinting *)
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   133
  val Term_to_string : Term -> string
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
   134
end;