Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mettalog doesnt evaluate with nested match #216

Open
drspro opened this issue Dec 10, 2024 · 3 comments
Open

mettalog doesnt evaluate with nested match #216

drspro opened this issue Dec 10, 2024 · 3 comments
Labels
question Further information is requested

Comments

@drspro
Copy link
Collaborator

drspro commented Dec 10, 2024

; probably collapse add
; (sudoku_board 9 7 9 7 )
; (sudoku_puzzle_state 1 1 5 )

(= (sudoku_quad_num $rowx $colx)
(match &self ( sudoku_board $rowx $colx $quadn $nothing )
$quadn ) )

(= (get_quad_stateyz $quadn)
(match &self ( sudoku_puzzle_state $row $colx $state ) (
(if (and (> $state 0) (== (sudoku_quad_num $row $colx) $quadn ) )
(cell_xstate $row $colx $state)
(empty)
) ) )
)
qwe_Image6

@TeamSPoon TeamSPoon added the question Further information is requested label Dec 13, 2024
@TeamSPoon
Copy link
Collaborator

can you supply a small case to reproduce the bug?

(sudoku_board 9 7 9 7 )
(sudoku_puzzle_state 1 1 5 )

(= (sudoku_quad_num $rowx $colx)
(match &self ( sudoku_board $rowx $colx $quadn $nothing )
$quadn ) )

(= (get_quad_stateyz $quadn)
    (match &self ( sudoku_puzzle_state $row $colx $state ) (
    (if (and (> $state 0) (== (sudoku_quad_num $row $colx) $quadn ) )
    (cell_xstate $row $colx $state)
    (empty)) ) )
    ```
    
is missing   `cell_xstate`

and what would bre the query to try?


    

@drspro
Copy link
Collaborator Author

drspro commented Dec 13, 2024

Im finding the code because i changed it since, i thought i added the whole file,

@drspro
Copy link
Collaborator Author

drspro commented Dec 13, 2024

I have just tested it also, it works in hyperon but not in mettalog, this is the smallest example for that nested match
sudoku_nest_match.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants