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

Proper formatting of placeholders in TPTP #49

Open
ZachJHansen opened this issue Dec 15, 2023 · 1 comment
Open

Proper formatting of placeholders in TPTP #49

ZachJHansen opened this issue Dec 15, 2023 · 1 comment
Labels
A-convenience Area: Convenience features C-cleanup Category: Cleanup C-enhancement Category: Enhancement E-hard Experience: Hard L-fol Language: First-order logic P-low Priority: Low

Comments

@ZachJHansen
Copy link
Collaborator

ZachJHansen commented Dec 15, 2023

Placeholders are syntactically indistinguishable from symbolic constants, but semantically they behave like free variables. Since TPTP requires type-casting for comparisons, e.g.

$lesseq(a, n)

is forbidden if a is a function constant but n is an integer placeholder, this makes formatting them correctly in TPTP very inconvenient. Currently using a temporary rename-and-replace strategy with regexes as a post-processing step in zach/dev.

One option is to make placeholders part of the fol AST: general-sorted placeholders are treated similarly to symbolic constants and integer-sorted placeholders are treated similarly to integer terms. So, rather than replacing them with variables of the appropriate sort, we could replace them with zero-arity functions of the appropriate sort.

Ultimately, I'm not sure there is a perfect way to do this. Parsing and formatting should be context-independent, but the presence of a user guide affects whether n is treated as a symbolic constant, a free-valued integer function, or a free valued general function.

@ZachJHansen ZachJHansen added P-low Priority: Low E-hard Experience: Hard C-cleanup Category: Cleanup C-enhancement Category: Enhancement L-fol Language: First-order logic A-convenience Area: Convenience features labels Dec 15, 2023
@teiesti
Copy link
Collaborator

teiesti commented Apr 5, 2024

FunctionConstants have been added to the FOL syntax tree in #78. All what is missing to resolve this issue is replacing symbolic constants in formulas corresponding to programs with function constants when specified in the user guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-convenience Area: Convenience features C-cleanup Category: Cleanup C-enhancement Category: Enhancement E-hard Experience: Hard L-fol Language: First-order logic P-low Priority: Low
Projects
None yet
Development

No branches or pull requests

2 participants