Commit 24311a62 authored by Andrei Paskevich's avatar Andrei Paskevich

tptp: defined symbols

parent 722d4afe
......@@ -254,8 +254,7 @@ and comment_line = parse
let ast = with_location (tptp_file token) lb in
(), Tptp_typing.typecheck env path ast
(* let library_of_env = Env.register_format "tptp" ["p";"ax"] read_channel *)
let library_of_env = Env.register_format "tff1" ["p";"ax"] read_channel
let library_of_env = Env.register_format "tptp" ["p";"ax"] read_channel
}
(*
......
This diff is collapsed.
theory Univ
type iType
end
theory Ghost
type gh 'a
constant gh : gh 'a
end
theory Int
use export int.Int
end
theory IntTrunc
function floor (x : int) : int = x
function ceil (x : int) : int = x
function truncate (x : int) : int = x
function round (x : int) : int = x
function to_int (x : int) : int = x
predicate is_int int = true
predicate is_rat int = true
end
theory IntDivE
use export int.EuclideanDivision
end
theory IntDivT
(* TODO: divide and truncate *)
function div_t (x y : int) : int
function mod_t (x y : int) : int
end
theory IntDivF
(* TODO: divide and floor *)
function div_f (x y : int) : int
function mod_f (x y : int) : int
end
theory Rat
use int.Int
type rat
predicate (< ) (x y : rat)
predicate (> ) (x y : rat) = y < x
predicate (<=) (x y : rat) = x < y \/ x = y
clone export algebra.OrderedField
with type t = rat, predicate (<=) = (<=)
function frac (n d : int) : rat
function numerator rat : int
function denominator rat : int
axiom inversion : forall r : rat. r = frac (numerator r) (denominator r)
axiom dpositive : forall r : rat. Int.(>) (denominator r) 0
axiom frac_zero : forall d : int. d <> 0 -> frac 0 d = zero
axiom frac_unit : forall d : int. d <> 0 -> frac d d = one
axiom nume_zero : numerator zero = 0
axiom deno_zero : denominator zero = 1
axiom nume_unit : numerator one = 1
axiom deno_unit : denominator one = 1
axiom proportion : forall n1 n2 d1 d2 : int. d1 <> 0 -> d2 <> 0 ->
(frac n1 d1 = frac n2 d2 <-> Int.(*) n1 d2 = Int.(*) n2 d1)
function to_rat (x : rat) : rat = x
predicate is_int (r : rat) = denominator r = 1
predicate is_rat rat = true
end
theory RatTrunc
use import Rat
(* TODO: axiomatize *)
function floor (x : rat) : rat
function ceil (x : rat) : rat
function truncate (x : rat) : rat
function round (x : rat) : rat
function to_int (x : rat) : int = numerator (floor x)
end
theory RatDivE
use import Rat
(* TODO: euclidean division *)
function div (x y : rat) : rat
function mod (x y : rat) : rat
end
theory RatDivT
use import Rat
(* TODO: divide and truncate *)
function div_t (x y : rat) : rat
function mod_t (x y : rat) : rat
end
theory RatDivF
use import Rat
(* TODO: divide and floor *)
function div_f (x y : rat) : rat
function mod_f (x y : rat) : rat
end
theory Real
use export real.Real
function to_real (x : real) : real = x
end
theory RealTrunc
use import Real
use import real.FromInt
use export real.Truncate
(* TODO : axiomatize *)
function round (x : real) : real
function to_int (x : real) : int = floor x
predicate is_int (r : real) = r = from_int (truncate r)
predicate is_rat (r : real) =
exists n d : int. d <> 0 /\ r * from_int d = from_int n
end
theory RealDivE
(* TODO: euclidean division *)
function div (x y : real) : real
function mod (x y : real) : real
end
theory RealDivT
(* TODO: divide and truncate *)
function div_t (x y : real) : real
function mod_t (x y : real) : real
end
theory RealDivF
(* TODO: divide and floor *)
function div_f (x y : real) : real
function mod_f (x y : real) : real
end
theory IntToRat
use import Rat
function to_rat (x : int) : rat = frac x 1
end
theory IntToReal
use import real.FromInt
function to_real (x : int) : real = from_int x
end
theory RealToRat
use import Rat
(* TODO: axiomatize *)
function to_rat (x : real) : rat
end
theory RatToReal
use import Rat
use import real.Real
use import real.FromInt
function to_real (x : rat) : real =
from_int (numerator x) / from_int (denominator x)
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment