Skip to content

prove axiom fn in tlb.rs#570

Open
Je5s1e wants to merge 7 commits into
asterinas:mainfrom
Je5s1e:prove/specs_mm_tlb
Open

prove axiom fn in tlb.rs#570
Je5s1e wants to merge 7 commits into
asterinas:mainfrom
Je5s1e:prove/specs_mm_tlb

Conversation

@Je5s1e

@Je5s1e Je5s1e commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

This PR removes two axiom-backed tracked helpers from ostd/specs/mm/tlb.rs by providing concrete proof implementations for them.

@rikosellic

Copy link
Copy Markdown
Collaborator

This looks a bit strange. The TlbModel is a tracked struct while all fields are ghost. I believe this is a verification design issue. I will look into it later.

Comment thread ostd/specs/mm/tlb.rs
pub mappings: Set<Mapping>,
pub tracked struct TlbModel {
pub ghost pending: Seq<TlbFlushOp>,
pub ghost mappings: Set<Mapping>,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks weird to me, why do you want to keep ghost inside tracked?

Comment thread ostd/specs/mm/tlb.rs
}

pub axiom fn tracked_update(&mut self, pt: PageTableView, va: Vaddr)
pub proof fn tracked_update(tracked &mut self, pt: PageTableView, va: Vaddr)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idiomatic way for doing so is to define a pure function, e.g., pub open spec fn update() and then define pub axiom fn tracked_update() to lift the spec to tracked mode.

Because this proof fn does not prove anything (you just want to do some tracked operations), there is no need to define the body.

@hiroki-chen

Copy link
Copy Markdown
Collaborator

This looks a bit strange. The TlbModel is a tracked struct while all fields are ghost. I believe this is a verification design issue. I will look into it later.

I also left some comments.

@Marsman1996 Marsman1996 added the AI-assist AI-aided proof or generation label Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-assist AI-aided proof or generation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants