Open
Conversation
…eferencing Lean hoare-triple library
- Created DafnySpecs directory for clean Dafny-to-Lean port - Moved all .dfy reference files to DafnySpecs/dafny/ - Implemented NpAdd.lean with multiple approaches: - Runtime size checking via hypotheses - Compile-time checking with Vector types - Polymorphic and refinement type variants - MPL-style specification comments for future verification - Includes theorems for commutativity, associativity, and identity
- Implement direct product using fold - Add range-based product matching Dafny's ProdArray specification - Include tail-recursive implementation for efficiency - Add MPL-style specifications for future verification - Provide vector and polymorphic approaches - Include properties like product of ones, zero handling - Add parallel product and zero-check optimizations - Provide Option-based API for safer empty array handling - Add comprehensive examples and test coverage The implementation follows the established patterns from NpAdd.lean and NpSum.lean, providing multiple approaches (runtime constraints, compile-time constraints, refinement types) for array product computation. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add LeanExplore to .mcp.json configuration alongside lean-lsp-mcp - Add MCP setup commands to Justfile (install-mcp-tools, setup-mcp, verify-mcp) - Update setup workflow to include MCP configuration for both CI and local dev - Add automatic installation for lean-lsp-mcp (via uv) and leanexplore (from GitHub) - Include MCP verification in main verify-setup command - Handle optional jq dependency gracefully in MCP commands The MCP tools enable better IDE integration for Lean 4 development: - lean-lsp-mcp: Provides LSP features via Model Context Protocol - leanexplore: Search engine for Lean 4 declarations with AI integration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Update .mcp.json to use correct CLI command: 'leanexplore mcp serve --backend local' - Add demo script showing local search works without API keys - Update documentation with successful local search example - Fix Justfile to use correct MCP command syntax - Ensure data fetch is included in setup process The setup now runs entirely locally: - No API keys required - All searches performed against local database - Privacy-preserving (no external API calls) Demo shows successful search for 'qsort' finding Array.qsort and related functions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Implement arange function with runtime size checking via hypotheses - Add tail-recursive variant for efficiency - Include vector approach with compile-time size calculation - Provide safe Option-based API for invalid parameters - Add specification theorems for first element, consecutive differences, and bounds - Support floating-point ranges with arangeFloat - Include polymorphic version for generic numeric types - Add helper functions like arangeSimple, arangeDefault, and range - Document MPL-style specifications for future verification The implementation follows patterns established in NpAdd, NpSum, and NpMax modules.
Port Dafny np_equal.dfy specification to idiomatic Lean 4: - Element-wise equality comparison returning Array Bool - Runtime size checking via hypotheses matching Dafny requires - Vector-based approach with compile-time size constraints - Polymorphic version for any type with decidable equality - Properties: reflexivity, symmetry, transitivity helpers - MPL-style specifications for future verification - Comprehensive examples and edge case handling Follows established patterns from NpAdd and NpAbs implementations. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Port np_greater.dfy and np_less.dfy to idiomatic Lean 4 with: - Element-wise comparison operations for arrays with size constraints - Vector-based implementations for compile-time size checking - Polymorphic versions for ordered types with DecidableRel - Properties about ordering (irreflexivity, transitivity) - MPL-style specifications for future verification - Count functions for filtering comparisons Both modules follow established patterns from NpEqual.lean and other DafnySpecs modules. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.