Skip to content

Commit

Permalink
Change theory function name field to string field.
Browse files Browse the repository at this point in the history
Clingo allows theory function names to be symbols like + and - (in
fact, that is how parsed theory terms are represented, e.g. the
unparsed theory term "a + b" is parsed into a theory function with
name + and arguments a, b. Therefore, restricting the name field to be
a constant field (as it was before this change) would be incorrect.
  • Loading branch information
namcsi committed Sep 24, 2023
1 parent bd98aa7 commit 9c83ded
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/renopro/predicates.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ class TheoryFunction(AstPredicate):
"""

id = IdentifierField
name = ConstantField
name = StringField
arguments = TheoryTerms.unary.Field


Expand Down
2 changes: 1 addition & 1 deletion tests/asp/reify_reflect/reified/theory_function.lp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ theory_atom(4,function(5),theory_atom_elements(7),theory_guard(13)).
function(5,a,terms(6)).
theory_atom_elements(7,0,theory_terms(8),literals(12)).
theory_terms(8,0,theory_function(9)).
theory_function(9,f,theory_terms(10)).
theory_function(9,"f",theory_terms(10)).
theory_terms(10,0,number(11)).
number(11,1).

0 comments on commit 9c83ded

Please sign in to comment.