(* all the syntactic types are interpreted as strings *)
np,n,s:=string;
JOHN := John;
MARY := Mary;
(* LOVE is interpreted as a function taking two arguments. The first one is the object and the second one is the subject. It returns the concatenation subject+loves+object *)
LOVE := lambda o s.s + loves + o;
EVERY := lambda n P. P (every + n);
SOME := lambda n P.P(some + n);
MAN := man;
WOMAN := woman;
end
(* Let's now look at the semantics *)
signature logic =
(* We define the usual types *)
e,t:type;
(* Then few non logical-constants *)
love:e -> e -> t;
j,m:e;
man,woman : e->t;
(* And finally, here are the logical constants *)
(* Cconjunction *)
infix & : t -> t -> t;
(* Implications*)
infix > : t -> t -> t;
(* Quantifiers *)
binder All : (e=>t) -> t;
binder Ex : (e=>t) -> t;
end
lexicon semantics (syntax) : logic =
(* We interpret np as entity, n as properties (s -> t) and of course s as propositions (truth values) *)
np := e;
n := e -> t;
s := t;
JOHN := j;
MARY := m;
MAN := man;
WOMAN := woman;
(* Note that we interpret LOVE whose first argument is the object and the second one as a suject using the predicate "love" for which love x y is true whenever x loves y *)