Skip to content

Commit

Permalink
Denote non-covert tenses
Browse files Browse the repository at this point in the history
  • Loading branch information
robintown committed Aug 3, 2023
1 parent 47d083d commit 0dcc039
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 6 deletions.
77 changes: 74 additions & 3 deletions src/semantics/denote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
ji,
nhana,
nhao,
presuppose,
realWorld,
some,
speechTime,
Expand Down Expand Up @@ -207,6 +208,66 @@ function denoteAspect(toaq: string): Expr {
}
}

// t | (t ⊆ t0)
const nai = presuppose(
v(0, ['i']),
subinterval(v(0, ['i']), speechTime(['i'])),
);

// t | (t < t0)
const pu = presuppose(v(0, ['i']), before(v(0, ['i']), speechTime(['i'])));

// t | (t > t0)
const jia = presuppose(v(0, ['i']), after(v(0, ['i']), speechTime(['i'])));

// λ𝘗. λ𝘸. ∃𝘵. 𝘗(𝘵)(𝘸)
const sula = λ(['i', ['s', 't']], [], c =>
λ('s', c, c => some('i', c, c => app(app(v(2, c), v(0, c)), v(1, c)))),
);

// λ𝘗. λ𝘸. ∃𝘵 : 𝘵 < t0. 𝘗(𝘵)(𝘸)
const mala = λ(['i', ['s', 't']], [], c =>
λ('s', c, c =>
some(
'i',
c,
c => app(app(v(2, c), v(0, c)), v(1, c)),
c => before(v(0, c), speechTime(c)),
),
),
);

// λ𝘗. λ𝘸. ∃𝘵 : 𝘵 > t0. 𝘗(𝘵)(𝘸)
const jela = λ(['i', ['s', 't']], [], c =>
λ('s', c, c =>
some(
'i',
c,
c => app(app(v(2, c), v(0, c)), v(1, c)),
c => after(v(0, c), speechTime(c)),
),
),
);

function denoteTense(toaq: string): Expr {
switch (toaq) {
case 'naı':
return nai;
case 'pu':
return pu;
case 'jıa':
return jia;
case 'sula':
return sula;
case 'mala':
return mala;
case 'jela':
return jela;
default:
throw new Error(`Unrecognized tense: ${toaq}`);
}
}

function denoteSpeechAct(toaq: string): string {
switch (toaq) {
case 'da':
Expand Down Expand Up @@ -276,8 +337,15 @@ function denoteLeaf(leaf: Leaf): Expr | null {

return denoteAspect(toaq);
} else if (leaf.label === 'T') {
if (leaf.word !== 'covert') throw new Error('TODO: non-covert T');
return v(0, ['i']);
if (leaf.word === 'functional') {
throw new Error('Functional T');
} else if (leaf.word === 'covert') {
return v(0, ['i']);
} else if (leaf.word.entry === undefined) {
throw new Error(`Unrecognized T: ${leaf.word.text}`);
} else {
return denoteTense(leaf.word.entry.toaq);
}
} else if (leaf.label === 'SA') {
let toaq: string;
if (leaf.word === 'functional') {
Expand Down Expand Up @@ -358,7 +426,10 @@ function getCompositionRule(left: DTree, right: DTree): CompositionRule {
case 'C':
return functionalApplication;
case 'T':
return reverseFunctionalApplication;
// Existential tenses use FA, while pronomial tenses use reverse FA
return Array.isArray(left.denotation?.type)
? functionalApplication
: reverseFunctionalApplication;
case '𝘷':
return eventIdentification;
}
Expand Down
6 changes: 3 additions & 3 deletions src/semantics/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ export function indeed(body: Expr): Expr {

export function quantifier(
name: (Expr & { head: 'quantifier' })['name'],
domain: 'e' | 'v' | 's',
domain: ExprType,
context: ExprType[],
body: (context: ExprType[]) => Expr,
restriction?: (context: ExprType[]) => Expr,
Expand Down Expand Up @@ -338,7 +338,7 @@ export function quantifier(
}

export function some(
domain: 'e' | 'v' | 's',
domain: ExprType,
context: ExprType[],
body: (context: ExprType[]) => Expr,
restriction?: (context: ExprType[]) => Expr,
Expand All @@ -347,7 +347,7 @@ export function some(
}

export function every(
domain: 'e' | 'v' | 's',
domain: ExprType,
context: ExprType[],
body: (context: ExprType[]) => Expr,
restriction?: (context: ExprType[]) => Expr,
Expand Down

0 comments on commit 0dcc039

Please sign in to comment.