Skip to content

Commit

Permalink
cleanup. fixed failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
philzook58 committed Jan 26, 2025
1 parent 1cf7045 commit 28cf767
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 4 deletions.
3 changes: 2 additions & 1 deletion kdrag/datatype.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""
Goodies related to datatypes.
Convenience features for datatypes.
You should use these instead of raw `smt.Datatype`. This also maintains a record of exisitng datatypes
so that you don't clobber old ones, a possible source of unsoundness.
Expand Down
11 changes: 11 additions & 0 deletions kdrag/hypothesis.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
"""
Helper functions for the hypothesis property based testing library.
This can be useful for:
- Giving counterexamples to poorly stated theorems before you spend much effort on them
- Sanity checking axioms
- Connecting formal models to other code
- Testing Knuckledragger facilities
- Testing Z3 intended meaning
"""

import kdrag as kd
import kdrag.smt as smt
import hypothesis
Expand Down
4 changes: 4 additions & 0 deletions kdrag/reflect.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
Reflecting and reifying SMT expressions from/into Python values.
"""

import kdrag.smt as smt
import kdrag as kd
import typing
Expand Down
Empty file removed kdrag/theories/logic/hol_light.py
Empty file.
8 changes: 8 additions & 0 deletions kdrag/theories/logic/ideas.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- Kuratowski topology <https://en.wikipedia.org/wiki/Kuratowski_closure_axioms>
- Peano arithmetic in the axiomatic style
- sequent calculus
- robinson arithmetic
- hol light
- modal logic
- Intuitionistic logic - Deep or shallow
- GAT
1 change: 0 additions & 1 deletion kdrag/theories/logic/kuratowski.py

This file was deleted.

Empty file removed kdrag/theories/logic/modal.py
Empty file.
Empty file removed kdrag/theories/logic/sequent.py
Empty file.
5 changes: 4 additions & 1 deletion kdrag/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@ def subterms(t: smt.ExprRef, into_binder=False):


def is_subterm(t: smt.ExprRef, t2: smt.ExprRef) -> bool:
"""
TODO: Not alpha invariant or going into binders
"""
if t.eq(t2):
return True
elif smt.is_app(t2):
Expand All @@ -345,7 +348,7 @@ def is_subterm(t: smt.ExprRef, t2: smt.ExprRef) -> bool:

def sorts(t: smt.ExprRef):
"""Generate all sorts in a term"""
for t in subterms(t):
for t in subterms(t, into_binder=True):
yield t.sort()


Expand Down
1 change: 0 additions & 1 deletion tests/test_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import kdrag.theories.logic.zf as zf
import kdrag.theories.logic.robinson as robinson
import kdrag.theories.logic.peano as peano
import kdrag.theories.logic.hol_light as hol_light


def test_logic():
Expand Down

0 comments on commit 28cf767

Please sign in to comment.