Docs / Syntax / Minimalist / Probe / Agree

The Agree operation

import Linglib.Syntax.Minimalist.Probe.Agree · namespace Minimalist.Probe

In Deal's interaction and satisfaction theory, Agree inspects the goals in the probe's domain one at a time. A goal that interacts with the probe has its interacting features copied to the probe and is flagged as interacting; a goal that satisfies the probe is flagged as its satisfier and ends the search; and a goal bearing a feature marked for dynamic interaction changes the interaction condition for the goals after it. Probe.Dynamic.agree is this operation for a probe that depends on a state, Probe.agree its case for a fixed probe, and Probe.Spec.agree its case for feature specifications, Deal's algorithm (30).

For a fixed probe, a search that meets no interacting goal leaves the state unchanged, so Agree fails without penalty as Preminger argues; the single goal of Probe.goal is the case in which every interacting goal satisfies the probe; and Multiple Agree is the case of an insatiable probe.

This is the one Agree of the library. A theory of Agree supplies a probe, which fixes what the search finds, and a copying operation, which fixes what Agree does to the state: valuation of feature bundles (Minimalist.FeatureState.value), the value of a case (Minimalist.agree_eq_search), or the features a probe accumulates (Probe.Spec.agree). When the state is the list of goals itself, Agree replaces each entry it interacts with (Probe.agreeList). When copying joins the state with what each goal contributes, the order of the goals does not matter: Agree joins the initial state with the contributions of the goals it flags.

Main definitions

Main results

Implementation notes

Movement, the M subfeatures of lines 5–6 and 9–10 of (30), is not modelled; Probe.attract gives movement a search of its own instead. Line 13 installs the closure of one feature marked for dynamic interaction; when a goal bears several, Spec.dynamicUpdate installs the features all of them dominate, which on a chain of features is the closure of the most specific one.

References

Declarations

The result of Agree over a goal sequence, the state after copying from every interacting goal, the goals flagged as interacting, in search order, and the goal flagged as the satisfier, if any.

structure ResultL96–105
(α : Type u_4) (σ : Type u_5) :
Type (max u_4 u_5)
  • state : σ

    The state after copying from every interacting goal.

  • interacted : List α

    The goals flagged as interacting, in search order.

  • satisfier : Option α

    The goal flagged as satisfying the probe, if the search was satisfied.

Used by Dynamic.agree, agree, Spec.agree

Used in Deal2024

Agree for a probe that depends on a state. Each goal in turn is flagged and copied from if it interacts with the probe of the current state, ends the search if it satisfies it, and otherwise moves the state by update before the next goal.

def Dynamic.agreeL117–128
{α : Type u_1} {σ : Type u_2} (P : Dynamic σ α) (copy update : α → σ → σ) :
σ → List α → Result α σ

The definition is too large to print here; read it in the source.

Built from ,

Used by Dynamic.agree_nil, Dynamic.agree_cons, Dynamic.agree_satisfier, agree

L132
L134–140

When satisfaction does not depend on the state, the satisfier is the first goal that satisfies the probe.

theorem Dynamic.agree_satisfierL142–150
{α : Type u_1} {σ : Type u_2} {P : Dynamic σ α} {copy update : α → σ → σ} {s : σ} {goals : List α} {q : Probe α} (h : ∀ (s : σ), (P s).sat = q.sat) :
(P.agree copy update s goals).satisfier = q.search goals

Built from ,

Agree for a fixed probe over an ordered goal sequence, copying from every interacting goal up to the first satisfier.

def agreeL154–157
{α : Type u_1} {σ : Type u_2} (p : Probe α) (copy : α → σ → σ) :
σ → List α → Result α σ

Built from ,

Used by agree_nil, agree_cons, agree_satisfier, agree_interacted, agree_state, le_agree_state, agree_state_eq_of_forall_not_int, agree_interacted_eq_goal, agree_state_eq_elim, relativized_agree_interacted, insatiable_agree_interacted, agree_sup_state, agreeList, Spec.agree_empty

Used in Syntax/Minimalist/Feature/Valuation, Syntax/Minimalist/Probe/Minimal, Amato2025

L165
L167–172
L174–176

The goals flagged as interacting are the inspected goals that interact.

@[simp] theorem agree_interactedL178–186
{α : Type u_1} {σ : Type u_2} {p : Probe α} {copy : α → σ → σ} {s : σ} {goals : List α} :
(p.agree copy s goals).interacted = List.filter (fun (x : α) => decide (p.int x)) (p.inspected goals)

Built from ,

The state is the fold of copy over the goals flagged as interacting.

theorem agree_stateL188–196
{α : Type u_1} {σ : Type u_2} {p : Probe α} {copy : α → σ → σ} {s : σ} {goals : List α} :
(p.agree copy s goals).state = List.foldl (fun (s : σ) (a : α) => copy a s) s (p.agree copy s goals).interacted

Built from

L198–205
L207–214
L216–220
L222–230

When every interacting goal satisfies the probe, the only goal flagged as interacting is the goal of the probe.

theorem agree_interacted_eq_goalL232–236
{α : Type u_1} {σ : Type u_2} {p : Probe α} {copy : α → σ → σ} {s : σ} {goals : List α} (h : ∀ (a : α), p.int a → p.sat a) :
(p.agree copy s goals).interacted = (p.goal goals).toList

Built from

L238–244

When copying joins the state with what each goal contributes, Agree joins the initial state with the contributions of the goals it flags.

theorem agree_sup_stateL257–266
{α : Type u_1} {σ : Type u_2} {p : Probe α} {s : σ} {goals : List α} [SemilatticeSup σ] [OrderBot σ] [DecidableEq α] (δ : α → σ) :
(p.agree (fun (a : α) (s : σ) => s ⊔ δ a) s goals).state = s ⊔ (List.filter (fun (x : α) => decide (p.int x)) (p.inspected goals)).toFinset.sup δ

Built from ,

Agree over a list of goals

L286
L288–293

Feature specifications

A probe specification over a feature type, [INT:int, SAT:sat] in Deal 2025a's notation. Each condition lists bundles of features, and a goal meets it when it bears every feature of one of them, so that a condition presents the upper set of the bundles containing one of its own: [INT:Ā+D, SAT:D] is ⟨{{Ā, D}}, {{D}}⟩, and a condition listing several bundles is a disjunction.

structure SpecL297–307
(F : Type u_4) :
Type u_4
  • int : Finset (Finset F)

    The bundles whose bearers the probe interacts with.

  • sat : Finset (Finset F)

    The bundles whose bearers halt the probe's search.

Used by Spec.equivProd, Spec.instPartialOrder, Spec.le_def, Spec.instOrderBot, Spec.instLatticeOfDecidableEq, Spec.sup_int, Spec.sup_sat, Spec.ofFeatures, Spec.intFeatures, Spec.satFeatures, Spec.toProbe, Spec.toProbe_int, Spec.toProbe_sat, Spec.sup_toProbe_int, Spec.sup_toProbe_sat, Spec.ofGeometry, Spec.relativized, Spec.agree, Spec.agree_satisfier, Spec.agree_empty, Spec.copied_agree_empty, Spec.mem_agree_interacted_iff

Used in Syntax/Minimalist/Probe/Minimal, BrananErlewine2024, Deal2025a, HammerlyMathieu2026

L321
L323–326
L328
L329
L334–335
L336–337
L343–349
L359–366
L368–370
L372–374
L390–392
L394–396
L398–400
L402–404
L420–422

When a goal bears every feature dominating one it bears, as in a privative geometry, it interacts with [INT:f] exactly when it bears f.

theorem Spec.ofGeometry_toProbe_int_iffL424–431
{α : Type u_1} {F : Type u_3} [DecidableEq F] {feats : α → Finset F} {a : α} [Preorder F] [LocallyFiniteOrderTop F] {f g : F} (hc : ∀ x ∈ feats a, ∀ y ≤ x, y ∈ feats a) :
((ofGeometry f g).toProbe feats).int a ↔ f ∈ feats a

Built from ,

L441–444

Agree (30) of Deal 2025a over goals exposing feature sets, dyn the features marked for dynamic interaction. The probe interacts by the current interaction condition, which starts as sp.int.

def Spec.agreeL446–452
{α : Type u_1} {F : Type u_3} [DecidableEq F] (sp : Spec F) (feats : α → Finset F) [Preorder F] [LocallyFiniteOrderTop F] (dyn : Finset F) (goals : List α) :
Result α (State F)

The definition is too large to print here; read it in the source.

Built from , ,

Used by Spec.agree_satisfier, Spec.agree_empty, Spec.copied_agree_empty, Spec.mem_agree_interacted_iff

L454–458

Dynamic interaction narrows the interaction condition to the features that a dynamic feature of the goal dominates.

theorem Spec.subset_Ici_of_mem_dynamicUpdateL460–468
{α : Type u_1} {F : Type u_3} [DecidableEq F] (feats : α → Finset F) [Preorder F] [LocallyFiniteOrderTop F] (dyn : Finset F) {a : α} {x : F} (hx : x ∈ feats a ∩ dyn) {int : Finset (Finset F)} {m : Finset F} (hm : m ∈ dynamicUpdate feats dyn a int) :
m ⊆ Finset.Ici x

Built from

L470–472

Without dynamic interaction, a specification Agrees as the probe it denotes, copying the interaction-specified features of each interacting goal.

theorem Spec.agree_emptyL474–487
{α : Type u_1} {F : Type u_3} [DecidableEq F] (sp : Spec F) (feats : α → Finset F) [Preorder F] [LocallyFiniteOrderTop F] (goals : List α) :
sp.agree feats ∅ goals = have r := (sp.toProbe feats).agree (fun (a : α) (c : Finset F) => c ∪ sp.intFeatures feats a) ∅ goals; { state := { copied := r.state, int := sp.int }, interacted := r.interacted, satisfier := r.satisfier }

Built from , , , ,

L489–497
L499–502
L504–506

After a sequence of goals the interaction condition is the one the last goal bearing a dynamic feature sets, and the initial condition if no goal bears one.

theorem Spec.foldl_dynamicUpdateL508–521
{α : Type u_1} {F : Type u_3} [DecidableEq F] (feats : α → Finset F) [Preorder F] [LocallyFiniteOrderTop F] (dyn : Finset F) (int : Finset (Finset F)) (l : List α) :
List.foldl (fun (i : Finset (Finset F)) (a : α) => dynamicUpdate feats dyn a i) int l = (List.filter (fun (a : α) => decide (feats a ∩ dyn).Nonempty) l).getLast?.elim int fun (b : α) => dynamicUpdate feats dyn b int

Built from

Agree with dynamic interaction flags a goal iff no goal before it satisfies the probe and it bears a feature of the interaction condition the goals before it leave, which foldl_dynamicUpdate reads off the last of them bearing a dynamic feature.

theorem Spec.mem_agree_interacted_iffL580–588
{α : Type u_1} {F : Type u_3} [DecidableEq F] (sp : Spec F) (feats : α → Finset F) [Preorder F] [LocallyFiniteOrderTop F] (dyn : Finset F) {a : α} (goals : List α) :
a ∈ (sp.agree feats dyn goals).interacted ↔ ∃ (l₁ : List α) (l₂ : List α), goals = l₁ ++ a :: l₂ ∧ (∀ b ∈ l₁, ¬(sp.toProbe feats).sat b) ∧ feats a ∈ upperClosure ↑(List.foldl (fun (i : Finset (Finset F)) (b : α) => dynamicUpdate feats dyn b i) sp.int l₁)

Built from , , ,