Commit 3b5d4e8
Add FuncSortRef and fix QuantifierRef.sort for lambdas (#118)
QuantifierRef.sort() hardcoded the Boolean sort, so a lambda expression
reported Bool instead of its actual function sort.
Return the real sort for lambdas, and introduce FuncSortRef so that
function sorts are more than an opaque SortRef. _to_sort_ref now routes
function sorts to it, giving every function sort - a lambda's or an
uninterpreted function's - the arity(), domain(), domain_n() and range()
accessors. Those names mirror Z3Py's ArraySortRef, where lambdas have
array sorts, so code inspecting a lambda's sort carries over from Z3Py.
cvc5 keeps function and array sorts distinct, so is_array_sort() still
reports False for them; add is_func_sort() to test for the new sort.
FuncDeclRef.arity/domain/range now delegate to the sort instead of each
re-deriving from getSort().getFunction*(), which is behavior-preserving:
every FuncDeclRef is built from a function sort.
This supersedes #115.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 4c0ce75 commit 3b5d4e8
1 file changed
Lines changed: 92 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
793 | 793 | | |
794 | 794 | | |
795 | 795 | | |
| 796 | + | |
| 797 | + | |
796 | 798 | | |
797 | 799 | | |
798 | 800 | | |
| |||
803 | 805 | | |
804 | 806 | | |
805 | 807 | | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
806 | 877 | | |
807 | 878 | | |
808 | 879 | | |
| |||
831 | 902 | | |
832 | 903 | | |
833 | 904 | | |
834 | | - | |
| 905 | + | |
| 906 | + | |
835 | 907 | | |
836 | 908 | | |
837 | 909 | | |
| |||
843 | 915 | | |
844 | 916 | | |
845 | 917 | | |
846 | | - | |
| 918 | + | |
| 919 | + | |
847 | 920 | | |
848 | 921 | | |
849 | 922 | | |
| |||
853 | 926 | | |
854 | 927 | | |
855 | 928 | | |
856 | | - | |
| 929 | + | |
| 930 | + | |
857 | 931 | | |
858 | 932 | | |
859 | 933 | | |
| |||
9050 | 9124 | | |
9051 | 9125 | | |
9052 | 9126 | | |
9053 | | - | |
| 9127 | + | |
| 9128 | + | |
| 9129 | + | |
| 9130 | + | |
| 9131 | + | |
| 9132 | + | |
| 9133 | + | |
| 9134 | + | |
| 9135 | + | |
| 9136 | + | |
| 9137 | + | |
| 9138 | + | |
| 9139 | + | |
| 9140 | + | |
| 9141 | + | |
9054 | 9142 | | |
9055 | 9143 | | |
9056 | 9144 | | |
| |||
0 commit comments